Testing If An Object Exists At Coordinates (x,y), How?
by Leo Gura · in Torque Game Builder · 09/30/2006 (7:59 pm) · 5 replies
I need a way to test whether an object of a certain class exists at a certain set of coordinates. Is there a function for this?
Also, is there a way to change the origin point of the object. For instance, I'd like to be able to rotate an object, but not around the center point, how would this be done. Also, I'd like to be able to offset the sprite a certain amount of pixels from the object's center.
Thanks.
Also, is there a way to change the origin point of the object. For instance, I'd like to be able to rotate an object, but not around the center point, how would this be done. Also, I'd like to be able to offset the sprite a certain amount of pixels from the object's center.
Thanks.
#2
09/30/2006 (11:48 pm)
Excellent! This is just what I was looking for. Thank you.
#3
There is no way to alter the origin point of an object. If you absolutely need to rotate it around a point other than center you have two choices. The first involves creating your image "off center" in the source file by adding extra alpha transparency off to one side. The second involves doing some trigonometry in script to reposition the object by a certain offset each time it is rotated.
10/01/2006 (1:17 am)
To answer your second question:There is no way to alter the origin point of an object. If you absolutely need to rotate it around a point other than center you have two choices. The first involves creating your image "off center" in the source file by adding extra alpha transparency off to one side. The second involves doing some trigonometry in script to reposition the object by a certain offset each time it is rotated.
#4
10/01/2006 (7:12 am)
If im not mistaken, another option to your second question would be to mount the object which needs to be offset to another, invisible sceneObject. Since you can place mount points anywhere you like, just place the mount point on the invisible sceneObject such that rotating it from the center will rotate your target sprite as needed. I believe this is the workaround that many people used back in the T2D days.
Torque Owner Corey Martin