Skip to main content
Tuoman
Senior II
March 16, 2020
Question

Get absolute position of a Drawable?

  • March 16, 2020
  • 1 reply
  • 642 views

Is there function to get absolute position of Drawable? getX() returns relative position within container.

So if I have 3 nested containers, I must do:

container1->getX() + container2->getX() + container3->getX() + drawable1->getX()

Is this the intended way, or am I missing something?

This topic has been closed for replies.

1 reply

LTimm.1
Associate
March 16, 2020

I haven't tried it myself lately, so a bit unsure, but maybe Drawable::getAbsoluteRect() is what you are looking for.