Classes incorrect with multiple scenewindows
by Nick Sinnott · in Torque Game Builder · 09/02/2006 (11:04 pm) · 3 replies
Short:
When a scenewindow is set to a scenegraph using t2dscenewindow::setSceneGraph() does it load a new instance of the graph or just view the existing one?
Long:
I've been trying to use multiple t2dSceneWindows on the same scenegraph (2-player split screen) by loading a level into SceneWindowOne, then using the returned scenegraph ID to setSceneGraph() of the SceneWindowTwo, which seemed to go work:
%graph = sceneWindowOne.loadLevel("SpaceWaste/data/levels/testLevel.t2d");
%cam = sceneWindowOne.getCurrentCameraArea();
sceneWindowTwo.setSceneGraph(%graph);
sceneWindowTwo.setCurrentCameraArea(%cam);
However, somehow my class names / namespaces are no longer getting set correctly, or at all.
To check, I've created a sprite with a class of "blah" in the level and added the following to game.cs:
function blah::onLevelLoaded (%this, %scenegraph)
{
echo ("blah loaded!");
}
However, I'm not seeing this show up in the console. Bug? As designed?
For good measure, here's the code from the .t2d file:
new t2dStaticSprite(test) {
imageMap = "circleImageMap";
frame = "0";
canSaveDynamicFields = "1";
class = "blah";
Position = "0 0";
size = "32.000 32.000";
mountID = "2";
Speed = "50";
};
When a scenewindow is set to a scenegraph using t2dscenewindow::setSceneGraph() does it load a new instance of the graph or just view the existing one?
Long:
I've been trying to use multiple t2dSceneWindows on the same scenegraph (2-player split screen) by loading a level into SceneWindowOne, then using the returned scenegraph ID to setSceneGraph() of the SceneWindowTwo, which seemed to go work:
%graph = sceneWindowOne.loadLevel("SpaceWaste/data/levels/testLevel.t2d");
%cam = sceneWindowOne.getCurrentCameraArea();
sceneWindowTwo.setSceneGraph(%graph);
sceneWindowTwo.setCurrentCameraArea(%cam);
However, somehow my class names / namespaces are no longer getting set correctly, or at all.
To check, I've created a sprite with a class of "blah" in the level and added the following to game.cs:
function blah::onLevelLoaded (%this, %scenegraph)
{
echo ("blah loaded!");
}
However, I'm not seeing this show up in the console. Bug? As designed?
For good measure, here's the code from the .t2d file:
new t2dStaticSprite(test) {
imageMap = "circleImageMap";
frame = "0";
canSaveDynamicFields = "1";
class = "blah";
Position = "0 0";
size = "32.000 32.000";
mountID = "2";
Speed = "50";
};
About the author
Torque Owner Unk
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2261
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2304
-Unk