|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.badlogic.gdx.scenes.scene2d.Actor com.badlogic.gdx.scenes.scene2d.Group com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup com.badlogic.gdx.scenes.scene2d.ui.HorizontalGroup
public class HorizontalGroup
A group that lays out its children side by side in a single row. This can be easier than using Table
when actors need
to be inserted in the middle of the group.
The preferred width is the sum of the children's preferred widths, plus spacing if set. The preferred height is the largest
preferred height of any child. The min size is the preferred size and the max size is 0 as HorizontalGroup
can be
stretched to cover any area.
This UI widget does not support Layout
able actors that return 0 as their preferred width. A fine example is
Label
class with text wrapping turned on.
Constructor Summary | |
---|---|
HorizontalGroup()
|
Method Summary | |
---|---|
HorizontalGroup |
align(int align)
Sets the alignment of widgets within the horizontal group. |
HorizontalGroup |
bottom()
Sets Align.bottom and clears Align.top for the alignment of widgets within the horizontal group. |
HorizontalGroup |
center()
Sets the alignment of widgets within the horizontal group to Align.center . |
HorizontalGroup |
fill()
|
HorizontalGroup |
fill(float fill)
|
int |
getAlign()
|
float |
getFill()
|
float |
getPadBottom()
|
float |
getPadLeft()
|
float |
getPadRight()
|
float |
getPadTop()
|
float |
getPrefHeight()
|
float |
getPrefWidth()
|
boolean |
getReverse()
|
float |
getSpace()
|
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() any each child whose width or height has changed, and calls Layout.validate() on each child. |
HorizontalGroup |
pad(float pad)
Sets the padTop, padLeft, padBottom, and padRight to the specified value. |
HorizontalGroup |
pad(float top,
float left,
float bottom,
float right)
|
HorizontalGroup |
padBottom(float padBottom)
|
HorizontalGroup |
padLeft(float padLeft)
|
HorizontalGroup |
padRight(float padRight)
|
HorizontalGroup |
padTop(float padTop)
|
HorizontalGroup |
reverse()
The children will be ordered from right to left rather than the default left to right. |
HorizontalGroup |
reverse(boolean reverse)
If true, the children will be ordered from right to left rather than the default left to right. |
void |
setRound(boolean round)
If true (the default), positions and sizes are rounded to integers. |
HorizontalGroup |
space(float spacing)
Sets the space between children. |
HorizontalGroup |
top()
Sets Align.top and clears Align.bottom for the alignment of widgets within the horizontal group. |
Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup |
---|
draw, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, invalidateHierarchy, needsLayout, pack, setFillParent, setLayoutEnabled, validate |
Methods inherited from class com.badlogic.gdx.scenes.scene2d.Group |
---|
act, addActor, addActorAfter, addActorAt, addActorBefore, clear, clearChildren, findActor, getChildren, hasChildren, hit, isTransform, localToDescendantCoordinates, print, removeActor, setCullingArea, setTransform, swapActor, swapActor |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HorizontalGroup()
Method Detail |
---|
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()
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 HorizontalGroup reverse()
public HorizontalGroup reverse(boolean reverse)
public boolean getReverse()
public HorizontalGroup space(float spacing)
public float getSpace()
public HorizontalGroup pad(float pad)
public HorizontalGroup pad(float top, float left, float bottom, float right)
public HorizontalGroup padTop(float padTop)
public HorizontalGroup padLeft(float padLeft)
public HorizontalGroup padBottom(float padBottom)
public HorizontalGroup padRight(float padRight)
public float getPadTop()
public float getPadLeft()
public float getPadBottom()
public float getPadRight()
public HorizontalGroup align(int align)
Align.center
, Align.top
,
Align.bottom
, Align.left
, Align.right
, or any combination of those.
public HorizontalGroup center()
Align.center
. This clears any other alignment.
public HorizontalGroup top()
Align.top
and clears Align.bottom
for the alignment of widgets within the horizontal group.
public HorizontalGroup bottom()
Align.bottom
and clears Align.top
for the alignment of widgets within the horizontal group.
public int getAlign()
public HorizontalGroup fill()
public HorizontalGroup fill(float fill)
fill
- 0 will use pref width.public float getFill()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |