com.badlogic.gdx.scenes.scene2d.ui
Class VerticalGroup

java.lang.Object
  extended by com.badlogic.gdx.scenes.scene2d.Actor
      extended by com.badlogic.gdx.scenes.scene2d.Group
          extended by com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
              extended by com.badlogic.gdx.scenes.scene2d.ui.VerticalGroup
All Implemented Interfaces:
Cullable, Layout

public class VerticalGroup
extends WidgetGroup

A group that lays out its children on top of each other in a single column. This can be easier than using Table when actors need to be inserted in 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 between them if set. The min size is the preferred size and the max size is 0.

Author:
Nathan Sweet

Constructor Summary
VerticalGroup()
           
 
Method Summary
 VerticalGroup align(int align)
          Sets the alignment of widgets within the vertical group.
 VerticalGroup center()
          Sets the alignment of widgets within the vertical group to Align.center.
 VerticalGroup fill()
           
 VerticalGroup 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.
 VerticalGroup left()
          Sets Align.left and clears Align.right for the alignment of 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 ordered from bottom to top rather than the default top to bottom.
 VerticalGroup reverse(boolean reverse)
          If true, the children will be ordered from bottom to top rather than the default top to bottom.
 VerticalGroup right()
          Sets Align.right and clears Align.left for the alignment of widgets within the vertical group.
 void setRound(boolean round)
          If true (the default), positions and sizes are rounded to integers.
 VerticalGroup space(float spacing)
          Sets the space between children.
 
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 com.badlogic.gdx.scenes.scene2d.Actor
addAction, addCaptureListener, addListener, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, fire, getActions, getCaptureListeners, getColor, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getUserObject, getWidth, getX, getY, getZIndex, hasParent, isAscendantOf, isDescendantOf, isTouchable, isVisible, localToAscendantCoordinates, localToParentCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, remove, removeAction, removeCaptureListener, removeListener, rotateBy, scaleBy, scaleBy, screenToLocalCoordinates, setBounds, setColor, setColor, setHeight, setName, setOrigin, setOriginX, setOriginY, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setUserObject, setVisible, setWidth, setX, setY, setZIndex, sizeBy, sizeBy, stageToLocalCoordinates, toBack, toFront, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VerticalGroup

public VerticalGroup()
Method Detail

invalidate

public void invalidate()
Description copied from interface: Layout
Invalidates this actor's layout, causing 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).

Specified by:
invalidate in interface Layout
Overrides:
invalidate in class WidgetGroup

layout

public void layout()
Description copied from interface: 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. This method should almost never be called directly, instead Layout.validate() should be used.

Specified by:
layout in interface Layout
Overrides:
layout in class WidgetGroup

getPrefWidth

public float getPrefWidth()
Specified by:
getPrefWidth in interface Layout
Overrides:
getPrefWidth in class WidgetGroup

getPrefHeight

public float getPrefHeight()
Specified by:
getPrefHeight in interface Layout
Overrides:
getPrefHeight in class WidgetGroup

setRound

public void setRound(boolean round)
If true (the default), positions and sizes are rounded to integers.


reverse

public VerticalGroup reverse()
The children will be ordered from bottom to top rather than the default top to bottom.


reverse

public VerticalGroup reverse(boolean reverse)
If true, the children will be ordered from bottom to top rather than the default top to bottom.


getReverse

public boolean getReverse()

space

public VerticalGroup space(float spacing)
Sets the space between children.


getSpace

public float getSpace()

pad

public VerticalGroup pad(float pad)
Sets the padTop, padLeft, padBottom, and padRight to the specified value.


pad

public VerticalGroup pad(float top,
                         float left,
                         float bottom,
                         float right)

padTop

public VerticalGroup padTop(float padTop)

padLeft

public VerticalGroup padLeft(float padLeft)

padBottom

public VerticalGroup padBottom(float padBottom)

padRight

public VerticalGroup padRight(float padRight)

getPadTop

public float getPadTop()

getPadLeft

public float getPadLeft()

getPadBottom

public float getPadBottom()

getPadRight

public float getPadRight()

align

public VerticalGroup align(int align)
Sets the alignment of widgets within the vertical group. Set to Align.center, Align.top, Align.bottom, Align.left, Align.right, or any combination of those.


center

public VerticalGroup center()
Sets the alignment of widgets within the vertical group to Align.center. This clears any other alignment.


left

public VerticalGroup left()
Sets Align.left and clears Align.right for the alignment of widgets within the vertical group.


right

public VerticalGroup right()
Sets Align.right and clears Align.left for the alignment of widgets within the vertical group.


getAlign

public int getAlign()

fill

public VerticalGroup fill()

fill

public VerticalGroup fill(float fill)
Parameters:
fill - 0 will use pref width.

getFill

public float getFill()


Copyright © 2014. All Rights Reserved.