Class AnchorLayout
java.lang.Object
com.blackrook.gui.layout.AnchorLayout
- All Implemented Interfaces:
GUILayout
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AnchorLayout.AnchorcreateAnchor(float left, float right, float top, float bottom) Creates an anchor attribute for objects in the layout.static AnchorLayout.AnchorReturns an Anchor that describes anchoring an object in the bottom-center of its parent.static AnchorLayout.AnchorReturns an Anchor that describes anchoring an object in the bottom-left of its parent.static AnchorLayout.AnchorReturns an Anchor that describes anchoring an object in the bottom-right of its parent.static AnchorLayout.AnchorReturns an Anchor that describes centering an object in its parent.static AnchorLayout.AnchorReturns an Anchor that describes anchoring an object in the middle-left of its parent.static AnchorLayout.AnchorReturns an Anchor that describes anchoring an object in the middle-right of its parent.static AnchorLayout.AnchorReturns an Anchor that describes anchoring an object in the top-center of its parent.static AnchorLayout.AnchorReturns an Anchor that describes anchoring an object in the top-left of its parent.static AnchorLayout.AnchorReturns an Anchor that describes anchoring an object in the top-right of its parent.voidresizeChild(GUIObject object, int index, int childTotal) Called when a child object needs resizing.
-
Field Details
-
AUTO
public static final float AUTOAnchor value for automatic alignment.- See Also:
-
UNUSED
public static final float UNUSEDAnchor value for ignoring an anchor point.- See Also:
-
-
Constructor Details
-
AnchorLayout
public AnchorLayout()
-
-
Method Details
-
resizeChild
Description copied from interface:GUILayoutCalled when a child object needs resizing. DO NOT RESIZE THE PARENT OBJECT IN THIS METHOD, AS IT MAY CAUSE AN INFINITE LOOP TO OCCUR.- Specified by:
resizeChildin interfaceGUILayout- Parameters:
object- the object to resize.index- the child index while traversing through the list of children.childTotal- the total number of children.
-
createAnchor
Creates an anchor attribute for objects in the layout. Left takes precedence over right, if not UNUSED. Top takes precedence over bottom, if not UNUSED.- Parameters:
left- units from the left. If auto, centered between left and right. If unused, ignored.right- units from the right. If auto, centered between left and right. If unused, ignored.top- units from the top. If auto, centered between top and bottom. If unused, ignored.bottom- units from the bottom. If auto, centered between top and bottom. If unused, ignored.- Returns:
- the created Anchor.
-
createCenteredAnchor
Returns an Anchor that describes centering an object in its parent. This doesn't actually return a new Anchor - it is a pooled one.- Returns:
- the created Anchor.
-
createTopLeftAnchor
Returns an Anchor that describes anchoring an object in the top-left of its parent. This doesn't actually return a new Anchor - it is a pooled one.- Returns:
- the created Anchor.
-
createTopCenterAnchor
Returns an Anchor that describes anchoring an object in the top-center of its parent. This doesn't actually return a new Anchor - it is a pooled one.- Returns:
- the created Anchor.
-
createTopRightAnchor
Returns an Anchor that describes anchoring an object in the top-right of its parent. This doesn't actually return a new Anchor - it is a pooled one.- Returns:
- the created Anchor.
-
createMiddleLeftAnchor
Returns an Anchor that describes anchoring an object in the middle-left of its parent. This doesn't actually return a new Anchor - it is a pooled one.- Returns:
- the created Anchor.
-
createMiddleRightAnchor
Returns an Anchor that describes anchoring an object in the middle-right of its parent. This doesn't actually return a new Anchor - it is a pooled one.- Returns:
- the created Anchor.
-
createBottomLeftAnchor
Returns an Anchor that describes anchoring an object in the bottom-left of its parent. This doesn't actually return a new Anchor - it is a pooled one.- Returns:
- the created Anchor.
-
createBottomCenterAnchor
Returns an Anchor that describes anchoring an object in the bottom-center of its parent. This doesn't actually return a new Anchor - it is a pooled one.- Returns:
- the created Anchor.
-
createBottomRightAnchor
Returns an Anchor that describes anchoring an object in the bottom-right of its parent. This doesn't actually return a new Anchor - it is a pooled one.- Returns:
- the created Anchor.
-