Multiple splash screens for itgb.
by Hitesh Patel · in iTorque 2D · 01/05/2010 (12:30 pm) · 2 replies
Hi,
I wanted to have multiple splash screens for my game on the iphone. At the moment it takes 12secs to load my game and it only shows the iTGB splash screen. I wanted to have my customised splash screen to show first and then the iTGB splash screen. How can i go about doing this? Also is possible to show an animated splash screen???
I wanted to have multiple splash screens for my game on the iphone. At the moment it takes 12secs to load my game and it only shows the iTGB splash screen. I wanted to have my customised splash screen to show first and then the iTGB splash screen. How can i go about doing this? Also is possible to show an animated splash screen???
#2
06/16/2010 (10:54 am)
For this I have a question. I simply used what worked in TGB, but does not here. ///main.cs in TGB
$splash = 1;
exec("~/gui/splash.gui");
exec("./gameScripts/splash.cs");
this is what I used in TGB. What do I need to do different in iTGB?
///in spalsh.cs
// Get number of splash screens from splash.ini
function getSplashNumber()
{
%nReturn = false;
%file = new FileObject();
if (%file.openForRead("./Settings/splash.ini"))
{
while ( !%file.isEOF() )
{
$splash = %file.readLine();
}
%file.close();
%nReturn = true;
}
return %nReturn;
}
// Load splash screen
function loadSplash()
{
// Load game
if ($splash == 0)
{
resetCanvas();
startGame($defaultScene);
}
// Display splash screen
else
{
splashGUI.bitmap = "~/data/splash/logo" @ $splash @ ".png";
canvas.popDialog(splashGUI);
canvas.pushDialog(splashGUI);
schedule(3000, 0, checkSplash);
$splash--;
}
}
// Check to see if splash screen should be loaded
function checkSplash()
{
if (splashGUI.done)
loadSplash();
else
schedule(100, 0, checkSplash);
}
Torque 3D Owner Marc Dreamora Schaerer
Gayasoft
For additional splash screens after that you could use script controlled GUI elements