APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.scenes.scene2d.ui

public Class Stack

extends WidgetGroup
Class Inheritance
Imports
com.badlogic.gdx.scenes.scene2d.Actor, .Touchable, com.badlogic.gdx.scenes.scene2d.utils.Layout, com.badlogic.gdx.utils.Array, .SnapshotArray

A stack is a container that sizes its children to its size and positions them at 0,0 on top of each other.

The preferred and min size of the stack is the largest preferred and min size of any children. The max size of the stack is the smallest max size of any children.

Author
Nathan Sweet

Field Summary

Modifier and TypeField and Description
private float
private float
private float
private float
private float
private float
private boolean

Constructor Summary

AccessConstructor and Description
public
public
Stack(Actor... actors)

Method Summary

Modifier and TypeMethod and Description
public void
add(Actor actor)

private void
public float
public float
public float
public float
public float
public float
public void
invalidate()

Overrides com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup.invalidate.

Implements com.badlogic.gdx.scenes.scene2d.utils.Layout.invalidate.

Invalidates this actor's layout, causing layout() to happen the next time validate() is called.

public void
layout()

Overrides com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup.layout.

Implements com.badlogic.gdx.scenes.scene2d.utils.Layout.layout.

Computes and caches any information needed for drawing and, if this actor has children, positions and sizes each child, calls invalidate() on any each child whose width or height has changed, and calls validate() on each child.

Inherited from com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup:
childrenChangeddrawhitinvalidateHierarchyneedsLayoutpacksetFillParentsetLayoutEnabledsizeChangedvalidate

Field Detail

maxHeightback to summary
private float maxHeight
maxWidthback to summary
private float maxWidth
minHeightback to summary
private float minHeight
minWidthback to summary
private float minWidth
prefHeightback to summary
private float prefHeight
prefWidthback to summary
private float prefWidth
sizeInvalidback to summary
private boolean sizeInvalid

Constructor Detail

Stackback to summary
public Stack()
Stackback to summary
public Stack(Actor... actors)

Method Detail

addback to summary
public void add(Actor actor)
computeSizeback to summary
private void computeSize()
getMaxHeightback to summary
public float getMaxHeight()

Overrides com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup.getMaxHeight.

Implements com.badlogic.gdx.scenes.scene2d.utils.Layout.getMaxHeight.

Doc from com.badlogic.gdx.scenes.scene2d.utils.Layout.getMaxHeight.

Zero indicates no max height.

getMaxWidthback to summary
public float getMaxWidth()

Overrides com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup.getMaxWidth.

Implements com.badlogic.gdx.scenes.scene2d.utils.Layout.getMaxWidth.

Doc from com.badlogic.gdx.scenes.scene2d.utils.Layout.getMaxWidth.

Zero indicates no max width.

getMinHeightback to summary
public float getMinHeight()

Overrides com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup.getMinHeight.

Implements com.badlogic.gdx.scenes.scene2d.utils.Layout.getMinHeight.

getMinWidthback to summary
public float getMinWidth()

Overrides com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup.getMinWidth.

Implements com.badlogic.gdx.scenes.scene2d.utils.Layout.getMinWidth.

getPrefHeightback to summary
public float getPrefHeight()

Overrides com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup.getPrefHeight.

Implements com.badlogic.gdx.scenes.scene2d.utils.Layout.getPrefHeight.

getPrefWidthback to summary
public float getPrefWidth()

Overrides com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup.getPrefWidth.

Implements com.badlogic.gdx.scenes.scene2d.utils.Layout.getPrefWidth.

invalidateback to summary
public void invalidate()

Overrides com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup.invalidate.

Implements com.badlogic.gdx.scenes.scene2d.utils.Layout.invalidate.

Doc from com.badlogic.gdx.scenes.scene2d.utils.Layout.invalidate.

Invalidates this actor's layout, causing layout() to happen the next time 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).

layoutback to summary
public void layout()

Overrides com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup.layout.

Implements com.badlogic.gdx.scenes.scene2d.utils.Layout.layout.

Doc from com.badlogic.gdx.scenes.scene2d.utils.Layout.layout.

Computes and caches any information needed for drawing and, if this actor has children, positions and sizes each child, calls invalidate() on any each child whose width or height has changed, and calls validate() on each child. This method should almost never be called directly, instead validate() should be used.