Adding Startup Splash Screens
As described in the Menu Script doc:
The menu script is referenced at the top of your game's menu layout file, like so:
LoadScript menu.gsl
RunScriptFunction MenuStartup
Basically what this says is that the layout will run the MenuStartup function in menu.gsl when the game loads. Since it's a standard GSL file like the main high-level game GSL or any of the controller GSL scripts, you can call any of the functions that are available to you in a full game.
To begin, create a project using any of the project templates that are included with Beyond Virtual.
Load the menu.gsl file in your favorite text editor (GameCore ships Programmer's Notepad as the default script editor).
The MenuStartup function looks something like the following (depending upon the project you have loaded):
void MenuStartup()
{
LoadBackdrop( "menu_main.psd");
ShowForm( "MainMenu");
}
As you may notice, all this does is load a backdrop and show the main menu.
The LoadBackdrop() function loads any image and displays it as the game's backdrop. Backdrops are shown 'behind' the world, so you can use this to show a bitmap behind objects in your menu (for a character selection / customization type of system) for example.
Lets extend the MenuStartup function to add a splash screen before the menu is displayed.
void MenuStartup()
{
// show splash screen before the menu
LoadBackdrop( "splashscreen.psd");
Delay(3);
LoadBackdrop( "menu_main.psd");
ShowForm( "MainMenu");
}
Simple enough, this loads a backdrop, pauses for 3 seconds and then loads the menu backdrop and shows our main menu.
Printer-friendly version- Login to post comments
- PDF version
