Giving Attributes a Fade Effect with their opacity

hulkspidy51hulkspidy51 Member Posts: 21
edited November -1 in Working with GS (Mac)
Hi guys! Pretty new to gamesalad. I was wondering if anyone knew how to create a fade effect to an actor. What I'm wanting to do it for the player to press on a card, when the card is released it plays an animation where the card flips over. How do I go about creating a delay after the animation and then creating a fade out effect so that it disappears

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    interpolate self color alpha to 0

    cheers
  • hulkspidy51hulkspidy51 Member Posts: 21
    Sweet! Thanks man!
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    ...and the delay after the animation can be made by using a Timer behavior, set to "After" so many seconds, then the Interpolate behavior as John advised. :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • old_kipperold_kipper Member Posts: 1,420
    Or you can feed the trigger to interpolate from a rule that reads the animation playing and then fires off a specific when>self image=
  • ORBZORBZ Member Posts: 1,304
    Interpolate has some drawbacks: Mainly that if you ever want to interrupt the fade FX you are going to cause the interpolate behavior to go wonky. If there is no chance of the fade being aborted then by all means, use interpolate, it's simple and easy to use. HOWEVER, i often find myself wanting to interrupt a fade effect thus I do this:

    rule some_condition_to_trigger_fade
    change attribute self.initTime = self.time

    rule some_condition_to_stop_fade
    change attribute self.initTime = 0
    change attribute self.alpha = 1

    rule self.alpha > 0 and self.initTime > 0:
    constrain self.alpha = cos(10*(self.time - self.initTime))

    // adjust 10 to however many seconds you want the fade to take.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Really neat, Orbz, I lik that! I've kept this post as a favourite, thanks. :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.