Need Help
by Pubily · in Torque Game Builder · 06/01/2009 (11:08 am) · 3 replies
This might be the most pathetic question to ask but I can't figure it out. Might be lack of sleep but I am stumped. I am loading a t2dStaticSprite into a simset, I am able to do .listObjects() and get back an object number. So I know that object is loading. My problem comes when I want to display the object in my game, I can't for the life of me figure out what to call. I am doing the following:
declaring my new simSet
$showing = new SimSet() {};
Then I load the SimSet in another function:
%toon = new t2dStaticSprite() {
imageMap = "toonImage";
frame = "4";
layer = "1";
canSaveDynamicFields = "1";
Position = "0 0";
size = "4.000 4.000";
WorldLimitMode = "NULL";
WorldLimitMin = "-50.160 -37.610";
WorldLimitMax = "50.317 37.127";
WorldLimitCallback = "1";
CollisionActiveSend = "1";
CollisionActiveReceive = "1";
CollisionPhysicsSend = "0";
CollisionPhysicsReceive = "0";
CollisionCallback = "1";
};
$showing.add(%toon);
When I run $showing.listObjects(); I get:
1352: t2dStaticSprite
Yes I am aware that I don't need to create a simset for one object but I am just testing things right now. Once I have it working I will be loading many objects in. So now all I want to do is make it appear on my screen but can't figure it out. Please help.
declaring my new simSet
$showing = new SimSet() {};
Then I load the SimSet in another function:
%toon = new t2dStaticSprite() {
imageMap = "toonImage";
frame = "4";
layer = "1";
canSaveDynamicFields = "1";
Position = "0 0";
size = "4.000 4.000";
WorldLimitMode = "NULL";
WorldLimitMin = "-50.160 -37.610";
WorldLimitMax = "50.317 37.127";
WorldLimitCallback = "1";
CollisionActiveSend = "1";
CollisionActiveReceive = "1";
CollisionPhysicsSend = "0";
CollisionPhysicsReceive = "0";
CollisionCallback = "1";
};
$showing.add(%toon);
When I run $showing.listObjects(); I get:
1352: t2dStaticSprite
Yes I am aware that I don't need to create a simset for one object but I am just testing things right now. Once I have it working I will be loading many objects in. So now all I want to do is make it appear on my screen but can't figure it out. Please help.
About the author
Torque 3D Owner Darius
SceneWindow2D.getSceneGraph().addToScene(%toon)
Or when you create %toon do something like this:
%toon = new t2dStaticSprite() {
sceneGraph = SceneWindow2D.getSceneGraph();
imageMap = "toonImage";
frame = "4";
layer = "1";
...
};