Absolute and local position for panels?

I’ve come across lots of instances where I was trying to gather the tx/ty offsets for a panel in reference to the top most container.

One use case for this is a helper dialogue UI that needs to be over the entire UI but should be positioned next to a specific attribute field.

Another use case is building a “tutorial mode” for software in Touch, where you highlight or inversely darken the area around a certain UI element.


I really like the panel.width and panel.height params that give the size no matter how it’s set.

I think it could be very useful if we got tx/ty in both local and world space where the bottom left corner’s coordinate was accurate no matter how the panel was placed or set, parented etc.

For local can you use the current .x .y members?

Ah didn’t realize that was a thing! Thanks for the tip Rob. I could using that and some recursive function find the abs position traversing up the hierarchy till the top.

though depending on the depth, could still be a lot of op calls of some sort or another.

If you do go recursive, make sure to use .panelParent() to find the right component.
(Parent panels can either be wired in, or the parent container).

Do your panel calculation needs require use of the current mouse position?
We used to have some functionality along those lines before python.