Game Development Community

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

About the author

Recent Threads


#1
07/09/2013 (5:28 pm)
Can't answer but looks like it's pretty easy to implement, shouldn't be an issue to create it by yourself if it's not there.
#2
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
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
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.