Absolute X/Y for mouse?
-
I feel like I've been here before but can't find anything in the search.
Is there a way to get the absolute position of the mouse on the front interface? When a component has a parent, the result of event.x / event.y is always relative to the parent, and if the parent has a parent it gets a little more complicated.
I'm writing a script that traverses the parents, stores their X/Y positions and then adds them all up but it's starting to get a bit convoluted. -
@Dan-Korneff each component has a getGlobalPositionX and Y methods, and you can use in addition to the event.x and y to get the global position of the mouse.
-
-
@Dan-Korneff If they are real components then @aaronventure is right, but if they are child panels (from
addChildPanel()
) then I reckon having an issue not getting the right global position