How to implement transition between different scene in T2D MIT
by Junji Takakura · in Torque 2D Beginner · 07/09/2013 (3:48 pm) · 5 replies
Is there any API to transitioning between different scene like storyboard in Corona SDK?
https://www.youtube.com/watch?v=Usv3QTZSJnc
https://www.youtube.com/watch?v=Usv3QTZSJnc
#2
And check this cool thing out - it would probably need a little updating for T2D MIT.
07/09/2013 (6:59 pm)
No, there is no "API" for this - but it's all just camera, scale and alpha tricks.And check this cool thing out - it would probably need a little updating for T2D MIT.
#3
- A Scenewindow object can only display one scene at a time. You would thus need 2 scenewindows, each one containing a different scene for transitions to work.
- You cannot set Scenes or SceneWindows' transparency or color. You would need to place a black (or white) Sprite on Scene Layer 0 and then scehdule a function which would make it gradually more/less visible or a different color.
As for camera movements, you should know that the SceneWindow has several functions to allow for smooth camera transitions.
First, you set up your desired camera targets :
Once you're ready to begin the transition, you simply call
With a combination of those techniques, you should be able to achieve pretty awesome scene transitions.
07/09/2013 (8:08 pm)
Here are a few things to think about if you plan to implement a similar system in T2D.- A Scenewindow object can only display one scene at a time. You would thus need 2 scenewindows, each one containing a different scene for transitions to work.
- You cannot set Scenes or SceneWindows' transparency or color. You would need to place a black (or white) Sprite on Scene Layer 0 and then scehdule a function which would make it gradually more/less visible or a different color.
As for camera movements, you should know that the SceneWindow has several functions to allow for smooth camera transitions.
First, you set up your desired camera targets :
SceneWindow.setTargetCameraSize(15,8.5);
SceneWindow.setTargetCameraPosition(x, y, speed);
SceneWindow.setTargetCameraZoom(1.0);
SceneWindow.setCameraInterpolationTime(0);
SceneWindow.setCameraInterpolationMode("SIGMOID");Once you're ready to begin the transition, you simply call
MainSceneWindow.startCameraMove();
With a combination of those techniques, you should be able to achieve pretty awesome scene transitions.
#4
Currently I don't understand SceneWindow, Scene and Camera well since there are no documents about them in wiki.
To understand them, Do I need to read the source codes?
07/10/2013 (7:21 am)
Thank you for your reply and I'll try to implement.Currently I don't understand SceneWindow, Scene and Camera well since there are no documents about them in wiki.
To understand them, Do I need to read the source codes?
#5
07/10/2013 (9:27 am)
@Richard: Thanks for the cool link, Twillex is a very cool and powerful engine, I have integrated it in T2D with minimal effort. To do so just read the instructions inside Twillex.cs.
Torque Owner Lukas Joergensen
WinterLeaf Entertainment