How do I get the area of a panel?
-
Rather noob question, but how do I get the area from a panel in my GUI?
I just to set some positions of objects inside the panel from its area. -
If you're within the paint routine of the panel you can use
this.getLocalBounds(0);
If you're in some other part of your script you can use
myPanel.get("x")
- replace "x" with "y", "width", "height", etc. - This will give you the position relative to its parent component.If you need the global position you can use
myPanel.getGlobalPositionX();
ormyPanel.getGlobalPositionY();
If you type "panel" into the API search in HISE you will see all of the functions that are available for panels.
-
@d-healey Thank you! You are always so helpful!