You can also do this in your app::Begin() method to display your own 'splash' quickly:
// display our splash
spl_img = agk::LoadImage("/media/mysplash.png");
spl_spr = agk::CreateSprite(spl_img);
agk::SetSpritePosition(spl_spr,0,0);
agk::SetSpriteSize(spl_spr,TA_GAM_WID,TA_GAM_HIH);
// set up to allow the splash to display for at least a little bit
slp_wait = agk::Timer() + 0.5f;
spl_vis = true;
The slp_wait (float,misspelled) and spl_vis (bool) variables are either globals or members of the app class defined in template.h.
slp_wait is used to decide how long you want to force your splash screen to display.
In the app::Loop() method:
// check for splash wait
if (spl_vis)
{
// wait for timeout
while (slp_wait > agk::Timer()) agk::Sync();
// clear variable
spl_vis = false;
// attempt to initialise everything
bad_start = initialiseGame();
// clean up startup bits
// clear the splash screen
deleteTheSprite(spl_spr);
deleteTheImage(spl_img);
}
Something similar in Tier 1 is also doable.
Cheers,
Ancient Lady
AGK Community Tester