Game Development Community

Gui Start Game Menu

by Jim Schuman · in Torque Game Builder · 02/21/2009 (3:13 pm) · 1 replies

I kinda forgot alot because I haven't used TGB in a while but I have a question.

I'm making a button in the gui and I want it to start the game, what was the command for loading the game?

#1
02/22/2009 (6:43 am)
here's what I do

I make a function onStartup.cs that contains

function onStartUp()
{
$mainScreen = mainScreenGui;
sceneWindow2D.loadLevel("game/data/levels/level.t2d");
}

make sure your game.cs has:

function startGame(%level)
{
exec("./exec.cs");
exec("./OnStartUp.cs");

lastly your gui button's command should be Command = "StartGame();";


I hope that helps!