Have a ImageMap question , please help me
by Chen Jay · in Torque Game Builder · 10/15/2007 (9:30 am) · 4 replies
Could you tell me a question
Why I use following way in TGB procedure, but can't demonstrate the picture while carrying out
$test = new t2dStaticSprite() {sceneGraph = t2dScene; };
$test.setImageMap( B5ImageMap ) ;
$test.setSize( " 8.261 11.929" );
$test.setPosition( " 25.870 22.305" );
$test.isSelectable = true;
$test.setVisible(true);
$test.LimitMode = " CLAMP" ;
$test.objectName = " B5" ;
$test.class = " B5" ;
There is a ImageMap that is named B5ImageMap in my Static Sprites
But type well above-mentioned establishment in the procedure
Pursue but not display, please help me to answer if not having wrong picture
thanks..
Why I use following way in TGB procedure, but can't demonstrate the picture while carrying out
$test = new t2dStaticSprite() {sceneGraph = t2dScene; };
$test.setImageMap( B5ImageMap ) ;
$test.setSize( " 8.261 11.929" );
$test.setPosition( " 25.870 22.305" );
$test.isSelectable = true;
$test.setVisible(true);
$test.LimitMode = " CLAMP" ;
$test.objectName = " B5" ;
$test.class = " B5" ;
There is a ImageMap that is named B5ImageMap in my Static Sprites
But type well above-mentioned establishment in the procedure
Pursue but not display, please help me to answer if not having wrong picture
thanks..
#3
function playerClass::onLevelLoaded(%this, %scenegraph)
{
$player = %this;
...
...
...
}
from then on, whenever you need to access the current scenegraph you can use:
$test = new t2dStaticSprite()
{
scenegraph = $player.scenegraph;
...
...
}
10/23/2007 (10:40 pm)
Make sure you're using the correct scenegraph name. What I do is have my player object's onLevelLoad command do something like this:function playerClass::onLevelLoaded(%this, %scenegraph)
{
$player = %this;
...
...
...
}
from then on, whenever you need to access the current scenegraph you can use:
$test = new t2dStaticSprite()
{
scenegraph = $player.scenegraph;
...
...
}
#4
test = new t2dStaticSprite() {sceneGraph = t2dScene; };
=> test = new t2dStaticSprite() {scenegraph = SceneWindow2D.getScenegraph(); }; or whatever the name of your actual scene window is. The default is SceneWindow2d.
10/24/2007 (12:30 pm)
You need to change this:test = new t2dStaticSprite() {sceneGraph = t2dScene; };
=> test = new t2dStaticSprite() {scenegraph = SceneWindow2D.getScenegraph(); }; or whatever the name of your actual scene window is. The default is SceneWindow2d.
Associate James Ford
Sickhead Games
$test = new t2dStaticSprite()
{
sceneGraph = t2dScene; // make sure this is the correct name. or try scenewindow2d.getscenegraph();
imageMap = B5ImageMap;
Size = "8261 11.929";
Position = "...";
...
}
Also make sure the code is actually getting executed.