Class UIHorizontalGridLayout
java.lang.Object
io.github.thecsdev.tcdcommons.api.client.gui.layout.UILayout
io.github.thecsdev.tcdcommons.api.client.gui.layout.UIHorizontalGridLayout
A
UILayout
that arranges a TParentElement
's children
in a horizontal grid-like order, where the children are placed next
to one another, continuing on the next "line" once the current
"line" runs out of space.-
Field Summary
Modifier and TypeFieldDescriptionprotected final HorizontalAlignment
protected final Point
protected final VerticalAlignment
Fields inherited from class io.github.thecsdev.tcdcommons.api.client.gui.layout.UILayout
defaultPsp
-
Constructor Summary
ConstructorDescriptionUIHorizontalGridLayout
(HorizontalAlignment hAlignment) UIHorizontalGridLayout
(HorizontalAlignment hAlignment, VerticalAlignment vAlignment) UIHorizontalGridLayout
(VerticalAlignment vAlignment) -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(TParentElement parent) Applies thisUILayout
to a givenTParentElement
.protected void
applyHAlignment
(TParentElement parent) protected void
applyVAlignment
(TParentElement parent) setMargin
(int x, int y) Sets the margin that will be applied to aTParentElement
's children as they get arranged into a grid.Methods inherited from class io.github.thecsdev.tcdcommons.api.client.gui.layout.UILayout
getDefaultPSP, getElementScrollPadding, nextChildBottomY, nextChildBottomY, nextChildVerticalRect, nextChildVerticalRect, setDefaultPSP
-
Field Details
-
hAlignment
-
vAlignment
-
margin
-
-
Constructor Details
-
UIHorizontalGridLayout
public UIHorizontalGridLayout() -
UIHorizontalGridLayout
-
UIHorizontalGridLayout
-
UIHorizontalGridLayout
public UIHorizontalGridLayout(HorizontalAlignment hAlignment, VerticalAlignment vAlignment) throws NullPointerException - Throws:
NullPointerException
-
-
Method Details
-
setMargin
Sets the margin that will be applied to aTParentElement
's children as they get arranged into a grid. The margin is the gap left between children.- Parameters:
x
- The horizontal margin.y
- The vertical margin.- Returns:
this
-
apply
Description copied from class:UILayout
Applies thisUILayout
to a givenTParentElement
. -
applyHAlignment
-
applyVAlignment
-