fade in fade out - is mistake in WIKI tut ?
Jaxter
Member, PRO Posts: 398
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..
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
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.
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
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...
But in your snapshot you are missing the Timer in the Otherwise -> Change Attribute.
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