fade in fade out - is mistake in WIKI tut ?

JaxterJaxter Member, PRO Posts: 398
edited November -1 in Working with GS (Mac)
Hello, i try to make fade in fade out.. here is nice tut for that http://gamesalad.com/wiki/how_tos:gsc_fade_image_in_and_out
but: is problem. When i create a boolean attribute called “FadeIn” in atribute browser "Fadein" is under GAME, but not under my actor ( SELF ) , so i can not make functions like that in tutorial: self.Fadein - i can make just game.Fadein

And the same problem was some time ago when i used to try figure out random size of actors..

Comments

  • CorellaCorella Member Posts: 37
    Hi,

    If I am understanding your problem correctly, you do not make the attribute in the 'main' attribute browser, but rather add a new attribute when editing the actual actor. Attributes created within the actor panel can be accessed via the expression editor as 'self. ...'

    http://i289.photobucket.com/albums/ll232/Magicraoul/demoattribute.png

    Hope that helps.
  • JaxterJaxter Member, PRO Posts: 398
    Ouuuuuuu great.. i did know that..
  • JaxterJaxter Member, PRO Posts: 398
    But how is possible to make it fade ( looping all the time fade in fade out slowly) It will be BG design element - underwater glow
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Start with a boolean attribute called, self.FadeIn and set it to false.
    I've changed the fading to a Timer and Change Attribute behavior instead of a Constrain Attribute because it gives you better control of the fade.

    Rule1: If Attribute self.FadeIn is false
    - Timer: every .1 seconds
    -- Change Attribtute: self.Color.Alpha = self.Color.Alpha - .01
    Otherwise:
    - Timer: every .1 seconds
    -- Change Attribtute: self.Color.Alpha = self.Color.Alpha + .01

    Rule2: If Attribute self.Color.Alpha = 0
    - Change Attribute: self.FadeIn = true

    Rule3: If Attribute self.Color.Alpha = 1
    - Change Attribute: self.FadeIn = false
  • JaxterJaxter Member, PRO Posts: 398
    realy thanks but i need it fade in and after that fade out... animation must come in and out really smooth.. not just fade in and disappear. but after that fade out..
  • JaxterJaxter Member, PRO Posts: 398
    I dit hat way.. but it does not work.. where is mistake?

    http://raganasligzda.lv/citi/fadein.png

    ps.. see on actor image.. it is PNG in BG that all the time must fading in fading out...
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    I updated the wiki. Its a little different from my post.

    But in your snapshot you are missing the Timer in the Otherwise -> Change Attribute.
  • JaxterJaxter Member, PRO Posts: 398
    does not working
  • JaxterJaxter Member, PRO Posts: 398
    i made like in updated viki: http://gamesalad.com/wiki/how_tos:gsc_fade_image_in_and_out all was great but when i test it second time no more transition... strange.. and ade in fade out was too fast i need each about 4 sec... what i must change there?
  • JaxterJaxter Member, PRO Posts: 398
    Now this is working but looping just disappear and does not come back

    Start with a boolean attribute called, self.FadeIn and set it to false.
    I've changed the fading to a Timer and Change Attribute behavior instead of a Constrain Attribute because it gives you better control of the fade.

    Rule1: If Attribute self.FadeIn is false
    - Timer: every .1 seconds
    -- Change Attribtute: self.Color.Alpha = self.Color.Alpha - .01
    Otherwise:
    - Timer: every .1 seconds
    -- Change Attribtute: self.Color.Alpha = self.Color.Alpha + .01

    Rule2: If Attribute self.Color.Alpha = 0
    - Change Attribute: self.FadeIn = true

    Rule3: If Attribute self.Color.Alpha = 1
    - Change Attribute: self.FadeIn = false
  • JaxterJaxter Member, PRO Posts: 398
    solved! i had - in bouth atributes
Sign In or Register to comment.