Hi does anyone know if there's a property on TouchSprite, or a property inherited from something else that will give you the centre coordinates of the TouchSprite with respect to the stage?
I have read through the api documentation but I can't find an easy answer to this one. I tried looking at the TouchVisualizer class as well but came up empty handed there too....
Basically I want to know the coordinates of the green circle that appears when you set debugDisplay to true on a TouchSprite. I know it's being drawn for the debugDisplay so that value must be available somewhere right?
The green circle is the cluster point center so it will not necessarily be the center of the object but rather the center point of all registered touch points. You can access this through the ClusterObject.
If you want the actual center point of the object, it's a simple calcuation.
var centerX:Number = touchSprite.width/2;
var centerY:Number = touchSprite.height/2;
Both of these points are local (relative to the touch sprite) not global. You will either need to account for the object's position or apply an local to global point conversion.
This topic is now closed. New replies are no longer allowed.
This topic is now archived. It is frozen and cannot be changed in any way.