Package me.hackware.api.gui.layout
Class UIElement<T extends UIElement<T>>
java.lang.Object
me.hackware.api.gui.layout.UIElement<T>
- Direct Known Subclasses:
Box,PlayerHead,Text
Base class for all UI elements in the flexbox-like layout system.
Uses a self-referential generic for fluent builder chaining on subclasses.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected intprotected intprotected intprotected intprotected intprotected intprotected intprotected intprotected intprotected intprotected Positionprotected intprotected intprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbottom(int v) height(int h) voidlayout(int x, int y) Set this element's final position and lay out children.left(int v) margin(int all) margin(int vertical, int horizontal) margin(int top, int right, int bottom, int left) marginBottom(int v) marginLeft(int v) marginRight(int v) marginTop(int v) abstract voidmeasure(net.minecraft.client.gui.Font font) Measure this element's intrinsic size.padding(int all) padding(int vertical, int horizontal) padding(int top, int right, int bottom, int left) paddingBottom(int v) paddingLeft(int v) paddingRight(int v) paddingTop(int v) abstract voidrender(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font font) Render this element using its computed layout coordinates.right(int v) size(int w, int h) top(int v) width(int w)
-
Field Details
-
paddingTop
protected int paddingTop -
paddingRight
protected int paddingRight -
paddingBottom
protected int paddingBottom -
paddingLeft
protected int paddingLeft -
marginTop
protected int marginTop -
marginRight
protected int marginRight -
marginBottom
protected int marginBottom -
marginLeft
protected int marginLeft -
position
-
posTop
protected int posTop -
posRight
protected int posRight -
posBottom
protected int posBottom -
posLeft
protected int posLeft -
fixedWidth
protected int fixedWidth -
fixedHeight
protected int fixedHeight
-
-
Constructor Details
-
UIElement
public UIElement()
-
-
Method Details
-
padding
-
padding
-
padding
-
paddingTop
-
paddingRight
-
paddingBottom
-
paddingLeft
-
margin
-
margin
-
margin
-
marginTop
-
marginRight
-
marginBottom
-
marginLeft
-
position
-
top
-
right
-
bottom
-
left
-
width
-
height
-
size
-
measure
public abstract void measure(net.minecraft.client.gui.Font font) Measure this element's intrinsic size. After calling, computedWidth and computedHeight are set. -
layout
public void layout(int x, int y) Set this element's final position and lay out children. Called by the parent after computing where this element should go. -
render
public abstract void render(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font font) Render this element using its computed layout coordinates.
-