Need Help: actor to transform into another actor at a slow speed

greglevygreglevy Member, PRO Posts: 85
edited November -1 in Working with GS (Mac)
When an actor is pressed I would like the actor to transform into another actor at a slow speed. I know I can use the change image behavior, but I would like a slow transformation.

Does anyone have any ideas?

Thanks
Greg

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi Greg, there's no actual morphing in GS, if that's what you mean. So if you do mean real morphing from one image to another, these will have to be made as animation frames, and used in the Animation behavior when you need it.

    On the other hand, if you mean you want one actor image to fade out while another fades in, that's perfectly possible. (There's no facility to fade within change image behavior unfortunately). So one way round this:

    When your actor is pressed, spawn a second actor (with your second image) in the first actor's exact position. Make sure this second actor's alpha is set to 0. Make two integer attributes, let's call them Actor1X and Actor1Y. In the first actor's Rules, put:

    When touch is pressed
    Change Attribute Actor1X to self.Position.x
    Change Attribute Actor1Y to self.Position.Y
    Spawn 2nd actor (image) --------- Make sure its Alpha is set to 0. in its Rules, change attributes self.x and self.y to Actor1X and Actor1Y respectively. Interpolate Alpha to 1 over 6 seconds.-------------
    Interpolate self.color.alpha to 1 over 6 seconds
    Timer: After 6 seconds
    Destroy actor

    Or, don't bother about fading out the original actor, if it can be covered by the second image; just have the new actor fade in over the top.

    Hope that helps you out.
  • greglevygreglevy Member, PRO Posts: 85
    Thanks

    Greg
Sign In or Register to comment.