Game Development Community

Splash screens

by Keith Mc Dowell JR · in Torque Game Builder · 06/08/2007 (12:01 pm) · 2 replies

Hey,
I'm eveywhere on these boards.. Have a question regarding Splash screen. I have two of them, that I want to display, of course one is GG Splash and the second one is mine. I've created two gui's, one called SplashGG.gui using the guibitmapfadeinfade for both of them. Place, the code in main.cs and game.cs but it only displays one of them.. and if I comment code out it displays the other..

Is there away to just have one splash.gui that takes care of both of them. Or is there a transition that I'm missing?

Thanks,

#1
06/08/2007 (4:29 pm)
At the end of initializeProject() in main.cs I call a function that I added called loadGGSplash().

function loadGGSplash()
{
canvas.setContent(ggSplash);
$ggSchedId = schedule(100, 0, checkGGSplash);
}

ggSplash is the name of a GuiFadeinBitmapCtrl. checkGGSplash() gets called every 100ms. done gets set when the fadein finishes.

function checkGGSplash()
{
if (ggSplash.done)
{
loadMySplash();
}
else
{
$ggSchedId = schedule(100, 0, checkGGSplash);
}
}

function loadMySplash()
{
canvas.setContent(mySplash);
$mySchedId = schedule(100, 0, checkMySplash);
}

mySplash is the name of a another GuiFadeinBitmapCtrl. checkMySplash() gets called every 100ms.

function checkMySplash()
{
if (mySplash.done)
{
startGame("myGame/data/levels/myGame.t2d");
}
else
{
$mySchedId = schedule(100, 0, checkMySplash);
}
}
#2
06/08/2007 (5:50 pm)
Hey, Thomas
Thanks a bunch for that snip of code !Awesome !