Panel#
- class UI.Panel()#
A container for user interface elements. Added to a
UI.Canvasor another panel.Base class:UI.ContainerInherited Members
- Panel.getStyle()#
- Panel.setStyle(value)#
How the background of the panel is drawn. A box is the frame to group related controls in, and is how a group box is made.
- Property:
Can be read or written
- Return type:
- Panel.getColor()#
- Panel.setColor(value)#
The color the background of the panel is tinted with.
- Property:
Can be read or written
- Return type:
Note
Has no effect while the style of the panel is
UI.PanelStyle.none, as the panel is then not drawn at all.
- Panel.getDraggable()#
- Panel.setDraggable(value)#
Whether the user can move the panel by dragging it.
- Property:
Can be read or written
- Return type:
boolean
Note
Dragging anywhere on the panel moves it, including over the elements it contains, unless one of them takes the pointer for itself. Give a panel a title bar of its own if only part of it should move it. A panel whose style is
UI.PanelStyle.noneis not drawn, so it takes no pointer events of its own and can only be dragged by the elements it contains.
- Panel.getLayout()#
The layout that arranges the elements of the panel, or
nullif they are positioned by hand.- Property:
Read-only, cannot be set
- Return type:
UI.Layoutornull
- Panel.addGridLayout()#
Arrange the elements of the panel in a grid of equally sized cells.
- Return type:
Note
The number of columns follows from the size of the panel and the size of a cell. Use
UI.Layout.getConstraint()to fix it instead.
- Panel.getSizeFitter()#
Sizes the panel to fit what it contains.
- Property:
Read-only, cannot be set
- Return type:
Note
Both directions start out unconstrained, which leaves the size of the panel alone.
- Panel.bringToFront()#
Draw the panel in front of the other elements beside it. Elements are drawn in the order they were added, so of two overlapping panels the newer hides part of the older until the older is brought to the front.
Note
A draggable panel also brings itself to the front when the user starts dragging it, the way a window comes to the front when it is clicked.
- class UI.PanelStyle()#
How the background of a panel is drawn.
- PanelStyle.window#
As a window, the heavier of the two frames the game uses.
- PanelStyle.box#
As a box, the lighter frame the game groups related controls in.
- PanelStyle.none#
Not drawn at all, leaving whatever is behind the panel showing through.