Newbie question about t2dStaticSprite
by Martin Goran Moravec · in Technical Issues · 03/15/2012 (2:48 am) · 2 replies
Hi,
I've tried recently to convert imagemaps from another project to torque (in attempt to find out how easy it would be to start developing games in Torque 2D using some of our older tools) and I'm a bit of puzzled with the documentation.
I've created a simple static sprite using the editor out of one old texture atlas - where I cut out the proper 1024x614 part of it. It looked as it was supposed to, but after saving I got rather unexpected size value (100,74.832)? What units are used for the size? (and where to look in the documentation for the description of it)
new t2dStaticSprite() {
imageMap = "image_0000_rgbaImageMap";
frame = "0";
useSourceRect = "1";
sourceRect = "0 0 1024 614";
canSaveDynamicFields = "1";
Position = "-0.000 0.000";
size = "100.000 74.832";
mountID = "2";
};
Also the description of the class itself does not contain anything about sourceRect in fact, is it just outdated, or am I just blind? :)
I've tried recently to convert imagemaps from another project to torque (in attempt to find out how easy it would be to start developing games in Torque 2D using some of our older tools) and I'm a bit of puzzled with the documentation.
I've created a simple static sprite using the editor out of one old texture atlas - where I cut out the proper 1024x614 part of it. It looked as it was supposed to, but after saving I got rather unexpected size value (100,74.832)? What units are used for the size? (and where to look in the documentation for the description of it)
new t2dStaticSprite() {
imageMap = "image_0000_rgbaImageMap";
frame = "0";
useSourceRect = "1";
sourceRect = "0 0 1024 614";
canSaveDynamicFields = "1";
Position = "-0.000 0.000";
size = "100.000 74.832";
mountID = "2";
};
Also the description of the class itself does not contain anything about sourceRect in fact, is it just outdated, or am I just blind? :)
Employee Michael Perry
ZombieShortbus
As for sourceRect, it's actually a relatively new feature that slipped through the cracks during the documentation pass. This feature acts like a more traditional texture atlas. From another post: