public class GuiHorizontalLayout extends GuiLayout
Children are added and removed with the usual addChild(GuiElement) and removeChild(GuiElement) methods.
The layout sets the font size of GuiLabel's, the border thickness and the background of GuiTextField's as well as the clickable status of all children when each child is added to the layout. These properties, as well as other visual properties, can be changed after adding the child.
The layout also sets the pivot position of each child on adding it; changing it is possible, but it is likely to disrupt the proper child placement within the layout.
The layout sets the position of each child each time the layout() is called; setting those position manually has no effect.
Important: due to the way Rising World plug-ins are loaded, this class cannot instantiated or used in any way from within the onEnable() method of a plug-in, as it is impossible to be sure that, at that moment, the RWGui plug-in has already been loaded.
The first moment one can be sure that all plug-ins have been loaded, and it is safe to use this class, is when (or after) the first player connects to the server (either dedicated or local).
Constructor and Description |
---|
GuiHorizontalLayout(int flags)
Creates an empty horizontal layout.
|
addChild, addChild, addChild, addNewLayoutChild, addNewTableLayoutChild, free, getItemData, getItemId, hide, layout, removeChild, setMargin, setPadding, show
destroy, equals, getAlpha, getBorderColor, getBorderThickness, getColor, getHeight, getHoverColor, getID, getParent, getParentID, getPivot, getPositionX, getPositionY, getWidth, hashCode, isRelativeBorderThickness, isRelativePosition, isRelativeSize, isVisible, refresh, removeFromParent, setAlpha, setBorderColor, setBorderColor, setBorderThickness, setColor, setColor, setPivot, setPosition, setSize, setVisible
public GuiHorizontalLayout(int flags)
flags
- one of RWGui.LAYOUT_H_LEFT, LAYOUT_H_CENTRE,
LAYOUT_H_RIGHT or LAYOUT_H_SPARSE to control the
horizontal distribution of children ORed with one of
LAYOUT_V_TOP, LAYOUT_V_MIDDLE and LAYOUT_V_BOTTOM
to control the vertical alignment.