public class VerticalGroup extends WidgetGroup
Table
when actors need to be inserted into or removed from the middle of the group.
The preferred width is the largest preferred width of any child. The preferred height is the sum of the children's preferred
heights plus spacing. The preferred size is slightly different when wrap
is enabled. The min size is the
preferred size and the max size is 0.
Widgets are sized using their preferred height
, so widgets which return 0 as their preferred
height will be given a height of 0.
Constructor and Description |
---|
VerticalGroup() |
Modifier and Type | Method and Description |
---|---|
VerticalGroup |
align(int align)
Sets the alignment of all widgets within the vertical group.
|
VerticalGroup |
bottom()
Sets
Align.bottom and clears Align.top for the alignment of all widgets within the vertical group. |
VerticalGroup |
center()
Sets the alignment of all widgets within the vertical group to
Align.center . |
VerticalGroup |
columnAlign(int columnAlign)
Sets the alignment of widgets within each column of the vertical group.
|
VerticalGroup |
columnCenter()
Sets the alignment of widgets within each column to
Align.center . |
VerticalGroup |
columnLeft()
Adds
Align.left and clears Align.right for the alignment of widgets within each column. |
VerticalGroup |
columnRight()
Adds
Align.right and clears Align.left for the alignment of widgets within each column. |
VerticalGroup |
expand() |
VerticalGroup |
expand(boolean expand)
When true and wrap is false, the columns will take up the entire vertical group width.
|
VerticalGroup |
fill() |
VerticalGroup |
fill(float fill) |
int |
getAlign() |
boolean |
getExpand() |
float |
getFill() |
float |
getPadBottom() |
float |
getPadLeft() |
float |
getPadRight() |
float |
getPadTop() |
float |
getPrefHeight() |
float |
getPrefWidth() |
boolean |
getReverse() |
float |
getSpace() |
boolean |
getWrap() |
float |
getWrapSpace() |
VerticalGroup |
grow()
Sets fill to 1 and expand to true.
|
void |
invalidate()
Invalidates this actor's layout, causing
Layout.layout() to happen the next time Layout.validate() is called. |
void |
layout()
Computes and caches any information needed for drawing and, if this actor has children, positions and sizes each child,
calls
Layout.invalidate() on any each child whose width or height has changed, and calls Layout.validate() on each
child. |
VerticalGroup |
left()
Adds
Align.left and clears Align.right for the alignment of all widgets within the vertical group. |
VerticalGroup |
pad(float pad)
Sets the padTop, padLeft, padBottom, and padRight to the specified value.
|
VerticalGroup |
pad(float top,
float left,
float bottom,
float right) |
VerticalGroup |
padBottom(float padBottom) |
VerticalGroup |
padLeft(float padLeft) |
VerticalGroup |
padRight(float padRight) |
VerticalGroup |
padTop(float padTop) |
VerticalGroup |
reverse()
The children will be displayed last to first.
|
VerticalGroup |
reverse(boolean reverse)
If true, the children will be displayed last to first.
|
VerticalGroup |
right()
Adds
Align.right and clears Align.left for the alignment of all widgets within the vertical group. |
void |
setRound(boolean round)
If true (the default), positions and sizes are rounded to integers.
|
VerticalGroup |
space(float space)
Sets the vertical space between children.
|
VerticalGroup |
top()
Sets
Align.top and clears Align.bottom for the alignment of all widgets within the vertical group. |
VerticalGroup |
wrap()
If false, the widgets are arranged in a single column and the preferred height is the widget heights plus spacing.
|
VerticalGroup |
wrap(boolean wrap) |
VerticalGroup |
wrapSpace(float wrapSpace)
Sets the horizontal space between columns when wrap is enabled.
|
draw, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, invalidateHierarchy, needsLayout, pack, setFillParent, setLayoutEnabled, validate
act, addActor, addActorAfter, addActorAt, addActorBefore, clear, clearChildren, debugAll, drawDebug, findActor, getChildren, getCullingArea, hasChildren, hit, isTransform, localToDescendantCoordinates, removeActor, removeActor, setCullingArea, setDebug, setTransform, swapActor, swapActor, toString
addAction, addCaptureListener, addListener, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, debug, fire, firstAscendant, getActions, getCaptureListeners, getColor, getDebug, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getUserObject, getWidth, getX, getX, getY, getY, getZIndex, hasActions, hasParent, isAscendantOf, isDescendantOf, isTouchable, isVisible, localToAscendantCoordinates, localToParentCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, remove, removeAction, removeCaptureListener, removeListener, rotateBy, scaleBy, scaleBy, screenToLocalCoordinates, setBounds, setColor, setColor, setDebug, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setPosition, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setUserObject, setVisible, setWidth, setX, setX, setY, setY, setZIndex, sizeBy, sizeBy, stageToLocalCoordinates, toBack, toFront
public void invalidate()
Layout
Layout.layout()
to happen the next time Layout.validate()
is called. This
method should be called when state changes in the actor that requires a layout but does not change the minimum, preferred,
maximum, or actual size of the actor (meaning it does not affect the parent actor's layout).invalidate
in interface Layout
invalidate
in class WidgetGroup
public void layout()
Layout
Layout.invalidate()
on any each child whose width or height has changed, and calls Layout.validate()
on each
child. This method should almost never be called directly, instead Layout.validate()
should be used.layout
in interface Layout
layout
in class WidgetGroup
public float getPrefWidth()
getPrefWidth
in interface Layout
getPrefWidth
in class WidgetGroup
public float getPrefHeight()
getPrefHeight
in interface Layout
getPrefHeight
in class WidgetGroup
public void setRound(boolean round)
public VerticalGroup reverse()
public VerticalGroup reverse(boolean reverse)
public boolean getReverse()
public VerticalGroup space(float space)
public float getSpace()
public VerticalGroup wrapSpace(float wrapSpace)
public float getWrapSpace()
public VerticalGroup pad(float pad)
public VerticalGroup pad(float top, float left, float bottom, float right)
public VerticalGroup padTop(float padTop)
public VerticalGroup padLeft(float padLeft)
public VerticalGroup padBottom(float padBottom)
public VerticalGroup padRight(float padRight)
public float getPadTop()
public float getPadLeft()
public float getPadBottom()
public float getPadRight()
public VerticalGroup align(int align)
Align.center
, Align.top
,
Align.bottom
, Align.left
, Align.right
, or any combination of those.public VerticalGroup center()
Align.center
. This clears any other alignment.public VerticalGroup top()
Align.top
and clears Align.bottom
for the alignment of all widgets within the vertical group.public VerticalGroup left()
Align.left
and clears Align.right
for the alignment of all widgets within the vertical group.public VerticalGroup bottom()
Align.bottom
and clears Align.top
for the alignment of all widgets within the vertical group.public VerticalGroup right()
Align.right
and clears Align.left
for the alignment of all widgets within the vertical group.public int getAlign()
public VerticalGroup fill()
public VerticalGroup fill(float fill)
fill
- 0 will use preferred height.public float getFill()
public VerticalGroup expand()
public VerticalGroup expand(boolean expand)
public boolean getExpand()
public VerticalGroup grow()
public VerticalGroup wrap()
When wrap is enabled, the group's preferred width depends on the height of the group. In some cases the parent of the group will need to layout twice: once to set the height of the group and a second time to adjust to the group's new preferred width.
public VerticalGroup wrap(boolean wrap)
public boolean getWrap()
public VerticalGroup columnAlign(int columnAlign)
Align.center
, Align.left
, or
Align.right
.public VerticalGroup columnCenter()
Align.center
. This clears any other alignment.public VerticalGroup columnLeft()
Align.left
and clears Align.right
for the alignment of widgets within each column.public VerticalGroup columnRight()
Align.right
and clears Align.left
for the alignment of widgets within each column.Copyright © 2017. All rights reserved.