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. The min size is the preferred size and the max size is 0.

Author:
Nathan Sweet

Constructor Summary
VerticalGroup()
           
 
Method Summary
 float getPrefHeight()
           
 float getPrefWidth()
           
 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.
 void setAlignment(int alignment)
          Sets the horizontal alignment of the children.
 void setReverse(boolean reverse)
          If true, the children will be ordered from bottom to top rather than the default top to bottom.
 void setSpacing(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, getWidth, getX, getY, getZIndex, hasParent, isAscendantOf, isDescendantOf, isVisible, localToAscendantCoordinates, localToParentCoordinates, localToStageCoordinates, notify, parentToLocalCoordinates, remove, removeAction, removeCaptureListener, removeListener, rotate, scale, scale, screenToLocalCoordinates, setBounds, setColor, setColor, setHeight, setName, setOrigin, setOriginX, setOriginY, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setVisible, setWidth, setX, setY, setZIndex, size, size, stageToLocalCoordinates, toBack, toFront, toString, translate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VerticalGroup

public VerticalGroup()
Method Detail

setAlignment

public void setAlignment(int alignment)
Sets the horizontal alignment of the children. Default is center.

See Also:
Align

setReverse

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


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

setSpacing

public void setSpacing(float spacing)
Sets the space between children.



Copyright © 2013. All Rights Reserved.