Splash Screen tutorial problem
by M. Stolley · in Torque Game Builder · 06/28/2006 (3:37 am) · 1 replies
Hi, me again,
i just try to make 2 splash screens as in this tutorial.
http://tdn.garagegames.com/wiki/Torque_2D/StandardTutorials/Basics/SplashScreen
My problem is that it will not work.
So becouse i am new to scripting i do not get it right.
If i start it, start with the game without display the two splash screens.
I think it is becouse the game.cs is running first in wich the startGame function starts the game before it can load the GGSplash function.
If i can load the GGSplash function first it will then go to the startGame function after displaying the two splashscreens in the game.cs.
So i think i must leave let the startGame function in the game.cs but if i do so it can not start the splash screens becouse it first start teh game.
Can someone explain me what i do wrong or how i can do it right, please.
Mathias
i just try to make 2 splash screens as in this tutorial.
http://tdn.garagegames.com/wiki/Torque_2D/StandardTutorials/Basics/SplashScreen
My problem is that it will not work.
So becouse i am new to scripting i do not get it right.
If i start it, start with the game without display the two splash screens.
I think it is becouse the game.cs is running first in wich the startGame function starts the game before it can load the GGSplash function.
If i can load the GGSplash function first it will then go to the startGame function after displaying the two splashscreens in the game.cs.
So i think i must leave let the startGame function in the game.cs but if i do so it can not start the splash screens becouse it first start teh game.
Can someone explain me what i do wrong or how i can do it right, please.
Mathias
Torque Owner Stephen Triche
Default Studio Name
Every GUI object has a callback function called onWake(). Whenever the GUI object is placed on the canvas, this function is called.
What I did was, in main.cs, use Canvas.setContent(GuiObjectName) to set your first splash screen.
That gui object's onWake function (which you must define yourself) will then be called.
You only need one line in that function, a schedule call that will call the next splash screen.
Canvas.schedule(time in milliseconds, setContent, NextGuiObjectName);
The 2nd gui object you just set to the canvas will have it's own onWake function in which you can schedule a call to startGame() :)