Using the setImageMap() function in TGB
by Josias Gibbs · in Torque Game Engine · 08/19/2008 (5:36 pm) · 4 replies
I'm trying to use the setImageMap() function to allow me to dynamically choose between several different image maps - but I"m having trouble figuring out the syntax of it. I wrote the following code, which uses the setImageMap() function in the simplest way I could think of:
new t2dImageMapDatablock(iMap01)
{
imageMode = "cell";
cellWidth = 200;
cellHeight = 150;
imageName = "./../data/images/The-Rock";
};
%this.owner.setImageMap(%iMap01, 0); //sets the sprite of the current object to frame 0 of image
//map "The-Rock"
The problem is, my code doesn't seem to DO anything. My images folder definitely contains a .png file called The-Rock. I'm new to TGB, so I wouldn't be surprised if I made some obvious syntax error - am I making any obvious errors?
new t2dImageMapDatablock(iMap01)
{
imageMode = "cell";
cellWidth = 200;
cellHeight = 150;
imageName = "./../data/images/The-Rock";
};
%this.owner.setImageMap(%iMap01, 0); //sets the sprite of the current object to frame 0 of image
//map "The-Rock"
The problem is, my code doesn't seem to DO anything. My images folder definitely contains a .png file called The-Rock. I'm new to TGB, so I wouldn't be surprised if I made some obvious syntax error - am I making any obvious errors?
About the author
Associate James Ford
Sickhead Games