Scene Transitions
osucowboy18
Member Posts: 1,307
Does anyone know the easiest way to create scene transitions in GameSalad? I'm not looking for anything fancy, just a simple transition like a fade to black or fade to white transition. Thanks.
- Alex
- Alex
Comments
Interpolate: self.color.alpha to 1, or 0 to have it transparent.
Make an actor named "Transition"
Make an attribute called game.transition in global attributes: a BOOLEAN attribute
When game.transition is TRUE, Then it will transition.
THIS CODE WILL TRANSITION FROM ALPHA TO BLACK, OR WHITE
Now. The following should be in the actor:
NOTE: USE 1 INSTEAD OF 0 IN THE NEXT 3 LINES TO MAKE IT TRANSITION TO WHITE
-Change attribute self.color.red to 0
-Change attribute self.color. green to 0
-Change attribute self.color. blue to 0
--Change attribute self.color. alpha to 0
NOTE: TO TRANSITION BACK IN, INTERPOLATE TO 0 FROM 1
--Rule: When game.transition = true
---Interpolate: self.color.alpha to 1; duration 2.5 seconds
--Otherwise: Change attribute self.color. alpha to 0
/END CODE
I hope this helped!
Just ask if you don't understand.
~CTM
- Alex
~CTM
- Alex
/CODE/
NOTE: USE 1 INSTEAD OF 0 IN THE NEXT 3 LINES TO MAKE IT FADE TO WHITE
-Change attribute self.color.red to 0
-Change attribute self.color. green to 0
-Change attribute self.color. blue to 0
--Change attribute self.color. alpha to 0
--Rule: When game.transitionOut = true
---Interpolate: self.color.alpha to 1; duration 2.5 seconds
--Otherwise: Change attribute self.color. alpha to 0
/END CODE/
FADE IN FROM BLACK:
/CODE/
NOTE: USE 1 INSTEAD OF 0 IN THE NEXT 3 LINES TO MAKE IT FADE IN FROM WHITE
-Change attribute self.color.red to 0
-Change attribute self.color. green to 0
-Change attribute self.color. blue to 0
--Change attribute self.color. alpha to 1
--Rule: When game.transitionIN = true
---Interpolate: self.color.alpha to 0; duration 2.5 seconds
--Otherwise: Change attribute self.color. alpha to 1
/END CODE/
You need a FADE IN actor and a FADE OUT actor in each scene. They need to be as big as the camera view.
The following is how you use them:
Change Scene Button:
/CODE/
--When touch is pressed:
---Change attribute game.transitionOut to TRUE
--Timer: after 2.5 seconds:
---change game.transitionOut to FALSE
---Chang Scene.....
/END CODE/
SCENE CONTROLLER(This needs to be in EVERY SCENE for the fade in to work!!)
/CODE/
--Change Attribute game.transitionIN to TRUE
--Timer:
---After 2.5 seconds change attribute game.transitionIN to FALSE
/END CODE/
This code Should work. I hope you can understand this;-)
~CTM
/END CODE/
~CTM
- Alex
Merry Christmas!
~CTM
Thanks.
- Alex
I will probably send it out in the morning.
~CTM
- Alex
~CTM
simon(AT)resqwest.NET
- Alex
keith (at) kc8(dot)com
To add to what he made you could put 3 interpolate behaviors in with the touch that triggers CTM's fade. Interpolate camera size width and camera size height to 0, and interpolate camera rotation to 360, and it will rotate while zooming into a fade.
Hope you dont mind me adding to this CTM, i just thought it might be useful to some people
@beefy_clyro, For some reason, the message came back to me, can you just email me?
MyGSUserName (at) gmail (dot) com
~CTM
Sorry to bother you all, is it possible for one of you with transition working
to email me a working sample ?
Many thanks.
You can mail me at : ios.b4sleep (at) gmail.com
Thanks again !
- Alex
anithmuk@hotmail.com