[sldev] Questions about UI and component positioning

Kelly Washington kelly at lindenlab.com
Wed May 30 19:09:19 PDT 2007


Ryan Kaskel wrote:
> I am messing around with the source code and wanted to clarify some
> things about UI component's positioning. What is the best way to
> position things? I noticed there is bottom_delta and bottom...first,
> what are these coordinates relative to? The entire window or just the
> "world frame" (sorry if these are vague)? Is bottom_delta the
> difference from the top and bottom the absolute position from the
> bottom? Is there no way to automatically "pack" the widgets?
>
> Thanks for your help!
> Epilort Byrne (Ryan)
> _______________________________________________
> Click here to unsubscribe or manage your list subscription:
> /index.html
UI layout is hierarchal - positions are relative to the parent element,
the element this element is in, which is usually an LLPanel or
derivative.  bottom is an 'absolute' distance down from the top of the
parent to the bottom of the element, top is an absolute distance down
from the top of the parent to the top of the element, left is an
absolute value from the left of the parent to the left side of the
element and right is an absolute value from the left of the parent to
the right side of the element.  Typically you just use two (left and
bottom) and a width and height.

The _delta versions are relative to the last defined element, NOT the
parent.  So for example if you wanted a row of buttons you could define
the first button's position with bottom and left.  Then define the rest
of the positions with bottom_delta = X and left_delta = 0, where X is
the size of a button plus some padding.

Hope this helps.

 - Kelly


More information about the SLDev mailing list