Pivot Points?
by David Cobb · in Torque Game Builder · 03/13/2005 (8:30 pm) · 2 replies
How come I can't set a pivot point for a sprite?
That just gets me the error...Unknown command
The documentation mentions pivot points a lot, but doesn't list a function to set/get them for sprites. I took a stab in the dark and came up with nothing. The functions were probably just forgotten (in the documentation or in the code).
Also, "0 3" is just a temporary pivot point. I realize this will be outside the object...just trying to get something I could see.
$player = new fxStaticSprite2D() { scenegraph = t2dSceneGraph; };
$player.setImageMap( im_helicopter_body );
$player.setSize( "20 20" );
$player.setPivotPoint("0 3");That just gets me the error...Unknown command
The documentation mentions pivot points a lot, but doesn't list a function to set/get them for sprites. I took a stab in the dark and came up with nothing. The functions were probably just forgotten (in the documentation or in the code).
Also, "0 3" is just a temporary pivot point. I realize this will be outside the object...just trying to get something I could see.
#2
1 Do we need to change them on the fly?
2 Can they lie outside of the sprites bounding rectangle?
3 Must the coincide with the rigid body center of gravity?
4 Can they somehow be stored inside the images themselves? (tga files can store an xy origin)
5 How should animated sprites with varying image size (if they are allowed in T2D) calculate their pivot points, as offsets from topleft or offsets from center?
I wrote a 2D engine for PocketPC known as Pocit Octopus a few years ago, pivot points were stored in separate files and loaded with the animations. We used Director as our in house tool which let you set the pivot point (Director call them registration points) and use onion skinning to check up your animations. Wrote three network Bluetooth games with it but the company went belly up before we could release it, sigh.
03/13/2005 (11:33 pm)
Some thoughts on pivot points:1 Do we need to change them on the fly?
2 Can they lie outside of the sprites bounding rectangle?
3 Must the coincide with the rigid body center of gravity?
4 Can they somehow be stored inside the images themselves? (tga files can store an xy origin)
5 How should animated sprites with varying image size (if they are allowed in T2D) calculate their pivot points, as offsets from topleft or offsets from center?
I wrote a 2D engine for PocketPC known as Pocit Octopus a few years ago, pivot points were stored in separate files and loaded with the animations. We used Director as our in house tool which let you set the pivot point (Director call them registration points) and use onion skinning to check up your animations. Wrote three network Bluetooth games with it but the company went belly up before we could release it, sigh.
Torque Owner Manuel F. Lara