Splash Screen
by baylor wetzel · in Torque Game Builder · 07/05/2006 (6:42 pm) · 1 replies
In main.cs it calls startGame but the comments say you should call a menu and a menu button should start the game. So that's what i tried to do. But i'm not doing it right
in main.cs, i comment out startGame and replaced it with Canvas.setContent(MainMenu); (not sure if that's the way you're supposed to load the main screen)
On MainMenu i created a button which has the command MainMenuHandler::onPlayButtonClicked(). onPlayButton has two lines. The first is echo("onPlayButtonClicked called"); which always fires, so i know i'm getting this far. The second is that startGame line from main.cs
When i click on TGB, the editor loads. When i hit F5/press start i see the level i was editing. MainMenu never comes and i never called startGame
Any ideas as to what i'm doing wrong?
in main.cs, i comment out startGame and replaced it with Canvas.setContent(MainMenu); (not sure if that's the way you're supposed to load the main screen)
On MainMenu i created a button which has the command MainMenuHandler::onPlayButtonClicked(). onPlayButton has two lines. The first is echo("onPlayButtonClicked called"); which always fires, so i know i'm getting this far. The second is that startGame line from main.cs
When i click on TGB, the editor loads. When i hit F5/press start i see the level i was editing. MainMenu never comes and i never called startGame
Any ideas as to what i'm doing wrong?
About the author
Torque 3D Owner Rodney Rindels - Torqued
Divide By Zero
look for this near the top.
and change that to
now you'll notice in your games/MyGame/main.cs file a section under initializeProject()
// Remove the following four lines if you would like to start the game without running the // level builder. if ($runWithEditors) { toggleLevelEditor(); return; }see whats its doing is saying, if you have $runWithEditors turned on, it will toggle the level editor on , and then return out of initializeProject so your Canvas.setContent() wont get called. By changing to false, Now execution can continue beyond that , and once your game starts , you can press F9 to toggleLevelEditor() via the keyboard, but you should see your startup sequence at least fire now.
Of course setting the $runWithEditors back to true reverses this behavior, and your game will startup into the levelEditor like your used too.
Hope that made sense :-)
-Rod