[SOLVED] How to get position and size of user-interface elements in screen coordinates?

I have some special ui elements that need to be controller with touch input.
If I understand correctly, there is no touch event on ui elements defined. Only touch events for the screen. So the touch coordinates are relative to screen.
I need to check if the touch is within an ui element.
So how do I get the screen element position and size expressed in screen coordinates? So that I can check if the touch is inside the ui element.

ah, found it:


I first found this one:


which seems what I was looking for. But that one give coordinates that are complete different from the touch coordinates. That confused me.
So the naming is different then I expected. The touch is expressed in canvasCoordinates.

1 Like