Game Development Community

Calling the t2dSceneGraph in TGB 1.1 Beta 2.

by Chris Serino · in Torque Game Builder · 04/03/2006 (4:05 pm) · 3 replies

How can I reference the scenegraph in the latest beta? Before, in the setupT2DScene function, there would be a t2dSceneGraph created. But now, it has been replaced with the startGame function, and there is no reference to the scenegraph anymore. How do I reference the scenegraph now? I need to call pickPoint on it.

#1
04/03/2006 (4:18 pm)
The loadLevel function being performed on the scene window will return a scenegraph ID...

like this

function startGame(%level)
{
   // Set The GUI.
   Canvas.setContent(mainScreenGui);
   Canvas.setCursor(DefaultCursor);
   
   moveMap.push();
   %sceneGraph = sceneWindow2D.loadLevel(%level);

   echo("sceneGraph = " @ %sceneGraph);
}
#2
04/03/2006 (4:23 pm)
Thanks for the quick reply!

The level editor + script classes combo make using TGB very nice.
#3
04/03/2006 (4:27 pm)
Np :) you can also load the level to a scenegraph, though the scenewindow option is my choice.

I completely agree, been a blast using it with Mighty Fist.