Game Development Community

Documentation: TGB Reference

by Vern Jensen · in Torque Game Builder · 06/19/2006 (10:51 pm) · 4 replies

In the TGB Reference, in the t2dSceneObject section, setPosition should explain HOW it positions the object according to the x and y coordinates you pass. Does it place the object's upper-left corner at that location? Does it center the object at that location? etc.

And similarly, getPosition() and friends should explain what they're returning. (Upper-left corner? Middle?)

-Vern

#1
06/19/2006 (11:15 pm)
It sets and gets position based on the registration point, default in the center.
#2
06/20/2006 (7:54 am)
@Vern - I had this same trouble myself and actually and it took me more time than was necessary to figure out. Basics like how positions and rotations work really should be in the docs.
#3
06/20/2006 (8:33 am)
As well how, if possible, to change them from center to other options like upper-left corner.
#4
06/20/2006 (11:44 am)
Sorry Hayden, currently there is no way to rotate an object around anything else than its center registration point. Also, there is no way to move the registration point from the center of an object.

There seem to be a few hacks around this, such as mounting the corner of an object (or what have you) to the center of a scene object and then rotating that object. Not pretty, but i suppose if you absolutely had to have this functionality, it can be faked.