TrickyWidget's Recent Forum Activity

  • Pick it by largest IID maybe?

    Unfortunately, I don't have any way of knowing what object the instance was created from. So I wouldn't know what to search for an IID. At the time of creation, this "nickname" is all I have.

  • Try this, not sure if its what you want though.

    Thank you for the effort.

    Here's what I'm trying to do:

    [attachment=1:2mq55056][/attachment:2mq55056]

    This creates a new instance of Sprite which was nicknamed "Monster", which is exactly what I wanted. However, now that I've created it, I need a reference to it so that I can work with it. So I need the UID or some other way of picking it.

    Example attached.

    Thanks again!

  • Maybe this could help..

    Thanks for the tip!

    That looks like it might be just what I need. I can create an instance from its nickname. However, so far I can't figure out how to get the UID of the instance that was created. Do you happen to know how to do that?

  • Thanks for creating these great addons!

    I have a question. Is it possible to get the UID of the instance created with Action:Nickname-Create instance?

    [attachment=0:24q5egmx][/attachment:24q5egmx]

    Thanks!

  • I have a family of sprites. I need to be able to create a particular one as indicated by the instance variable of another object. But I can't find any way to directly store an object reference in an instance variable. The best I've come up with so far is this:

    [attachment=0:2cu15kz1][/attachment:2cu15kz1]

    That works just fine, but I'm going to have over a hundred sprites in the family. Which means this sort of manual look-up table is going to get really unwieldy.

    Does anyone have any thoughts about a better way to do this?

    Thanks!

  • Well, I made a sort-of solution. I created an event group that repositions the sub-sprite to the main sprite's image point every tick. Then I turn it on at the beginning of the tween and off at the end of the tween. It's a total hack, but it works.

    Example attached.

    If anybody has any thoughts about a more elegant solution, I'd love to hear it!

  • I'm trying to tween the scale of a compound sprite and it's giving me trouble.

    I have the sub-sprites pinned to image points on the main sprite, and for the most part it works fine. But when I change the scale of all the various parts, they also change location relative to one another. I can re-orient them after the fact, except that I'm tweening the change of scale. Which means that all the parts smoothly scale into the wrong places and then suddenly leap to the right places at the end.

    I've tried giving each part its own tween, but I'm also rotating the main sprite so trying to keep up with the destinations of all the various parts is nigh impossible.

    Does anyone have any thoughts on how to work around this?

    A simple illustration of the problem using LiteTween is attached.

    Thanks!

    [attachment=1:qjps06qs][/attachment:qjps06qs]

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ok, this one should have fixed it, the scale tween vs mirror and flip.

    Wonderful, thank you!

    Could you explain the bug about 'Moving' with LiteTween undoing flip/mirror? The code on the position tween have nothing to do with Height or Width, so it shouldn't even affect anything about scale.

    Ah, my mistake! Looking back over my code, the moving I was thinking of also involved scaling. So it seems that was the whole thing. Sorry for the trouble.

    Thanks again for your great work!

  • You can duplicate the image and change the image point in the second frame.

    True, and that's what I'm doing for now. But I was hoping to not have to pack in extra images just to change a reference point.

  • First off, thank you! This is an essential function and I could hardly use C2 without it.

    Second, I think I found a bug when working with mirrored or flipped sprites. Moving or scaling them with LiteTween un-does the flip or mirror. Is there any way around this?

    Example attached.

    Thanks!

  • Is it possible to set the origin point of a sprite via code? I have a sprite that flips around relative to its container mates and managing it would be worlds easier if I could just change the origin.

    I did some searching and found this post, but that was some time ago and I thought I'd check in to see if it is possible these days.

    Thanks!

  • Containers only work if the objects are created dynamically.

    Ah, that's unfortunate. But thank you.

    I did find a sort-of work around. If I only place one of the instances in the container on the layout, then everything else will spawn and behave as intended. That doesn't allow a full visual design in the layout, but if I use the largest sprite in the container it makes for a pretty good sense of the final look.

TrickyWidget's avatar

TrickyWidget

Member since 30 Jun, 2014

None one is following TrickyWidget yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies