libgdx API

com.badlogic.gdx.scenes.scene2d.ui
Class Container.CellProperties

java.lang.Object
  extended by com.badlogic.gdx.scenes.scene2d.ui.Container.CellProperties
Enclosing class:
Container

public static class Container.CellProperties
extends java.lang.Object

Class specifying the layout of an Actor within a cell as well as the behaviour of th cell within the entire layout. See http://code.google.com/p/table-layout/ as well as the class documentation of Container.

Author:
mzechner

Constructor Summary
Container.CellProperties(Cell cell)
           
 
Method Summary
 Container.CellProperties align(int align)
          Sets the alignment of the Actor within the cell.
 Container.CellProperties colspan(int span)
          Sets how many columns this cell should span in the layout.
 Container.CellProperties expand(boolean x, boolean y)
          Sets whether the cell should take up the remaining space on the x- and y-axis.
 Container.CellProperties expand(int x, int y)
          Lets the cell take up all remaining space, specifying the weighting of the cell for expansion, relative to the weights of the other cells in the layout.
 Container.CellProperties fill(boolean x, boolean y)
          Sets whether to let the contained Actor fill the entire cell on the x- and y-axis.
 Container.CellProperties fill(float x, float y)
          Sets the percentage of space taken up by the contained Actor within the cell.
 Container.CellProperties maxSize(int width, int height)
          Sets the maximum size of the cell.
 Container.CellProperties minSize(int width, int height)
          Sets the minimum size of the cell.
 Container.CellProperties pad(int top, int left, int bottom, int right)
          Sets the padding on the top, left, bottom and right edge.
 Container.CellProperties padBottom(int bottom)
           
 Container.CellProperties padLeft(int left)
           
 Container.CellProperties padRight(int right)
           
 Container.CellProperties padTop(int top)
           
 Container.CellProperties spacing(int top, int left, int bottom, int right)
          Sets the spacing for the top, left, bottom and right edge of this cell.
 Container.CellProperties spacingBottom(int bottom)
           
 Container.CellProperties spacingLeft(int left)
           
 Container.CellProperties spacingRight(int right)
           
 Container.CellProperties spacingTop(int top)
           
 Container.CellProperties uniform(boolean x, boolean y)
          Cells marked as uniform on an axis will be the same size on that axis.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Container.CellProperties

public Container.CellProperties(Cell cell)
Method Detail

expand

public Container.CellProperties expand(boolean x,
                                       boolean y)
Sets whether the cell should take up the remaining space on the x- and y-axis. If multiple cells have expansion enabled on one or both axis, the size distribution will be weighted by the cells size determined from its Actor.

Parameters:
x - if true, all horizontal space is taken up.
y - if true, all vertical space is taken up.
Returns:
this Container.CellProperties for further manipulation.

expand

public Container.CellProperties expand(int x,
                                       int y)
Lets the cell take up all remaining space, specifying the weighting of the cell for expansion, relative to the weights of the other cells in the layout. Note: The expand(boolean, boolean) method will set the weights to 1.

Parameters:
x - the weight on x for expansion.
y - the weight on y for expansion.
Returns:
this Container.CellProperties for further manipulation.

fill

public Container.CellProperties fill(boolean x,
                                     boolean y)
Sets whether to let the contained Actor fill the entire cell on the x- and y-axis.

Parameters:
x - if true, the Actor takes up all horizontal space in the cell.
y - if true, the Actor takes up all vertical space int he cell.
Returns:
this Container.CellProperties for further manipulation.

fill

public Container.CellProperties fill(float x,
                                     float y)
Sets the percentage of space taken up by the contained Actor within the cell. Values have to be in the range 0.0f to 1.0f. A value of 0.0f will make the Actor use it's (preferred) size.

Parameters:
x - actor size between 0.0f to 1.0f on the x-axis (0-100% of the cell width)
y - actor size between 0.0f to 1.0f on the y-axis (0-100% of the cell height)
Returns:
this Container.CellProperties for further manipulation.

align

public Container.CellProperties align(int align)
Sets the alignment of the Actor within the cell. Use binary OR with the constants BaseTableLayout.TOP, BaseTableLayout.BOTTOM, BaseTableLayout.LEFT, BaseTableLayout.RIGHT, BaseTableLayout.CENTER.

Parameters:
align - the alignment.
Returns:
this Container.CellProperties for further manipulation.

colspan

public Container.CellProperties colspan(int span)
Sets how many columns this cell should span in the layout.

Parameters:
span - number of columns to span.
Returns:
this Container.CellProperties for further manipulation.

uniform

public Container.CellProperties uniform(boolean x,
                                        boolean y)
Cells marked as uniform on an axis will be the same size on that axis.

Parameters:
x - if true, this cell will be uniform on the x-axis
y - if true, this cell will be uniform on the y-axis
Returns:
this Container.CellProperties for further manipulation.

pad

public Container.CellProperties pad(int top,
                                    int left,
                                    int bottom,
                                    int right)
Sets the padding on the top, left, bottom and right edge. The padding is an inset inside the cell and takes away space available for the contained Actor.

Parameters:
top - the top padding
left - the left padding
bottom - the bottom padding
right - the right padding
Returns:
this Container.CellProperties for further manipulation.

padTop

public Container.CellProperties padTop(int top)
Parameters:
top - the top padding
Returns:
this Container.CellProperties for further manipulation.

padLeft

public Container.CellProperties padLeft(int left)
Parameters:
left - the left padding
Returns:
this Container.CellProperties for further manipulation.

padBottom

public Container.CellProperties padBottom(int bottom)
Parameters:
bottom - the bottom padding
Returns:
this Container.CellProperties for further manipulation.

padRight

public Container.CellProperties padRight(int right)
Parameters:
right - the right padding
Returns:
this Container.CellProperties for further manipulation.

spacing

public Container.CellProperties spacing(int top,
                                        int left,
                                        int bottom,
                                        int right)
Sets the spacing for the top, left, bottom and right edge of this cell. The spacing is space between this cell and adjacent cells. It will not take away space from the inside of the cell.

Parameters:
top - the top spacing
left - the left spacing
bottom - the bottom spacing
right - the right spacing
Returns:
this Container.CellProperties for further manipulation.

spacingTop

public Container.CellProperties spacingTop(int top)
Parameters:
top - the top spacing
Returns:
this Container.CellProperties for further manipulation.

spacingLeft

public Container.CellProperties spacingLeft(int left)
Parameters:
left - the left spacing
Returns:
this Container.CellProperties for further manipulation.

spacingBottom

public Container.CellProperties spacingBottom(int bottom)
Parameters:
bottom - the bottom spacing
Returns:
this Container.CellProperties for further manipulation.

spacingRight

public Container.CellProperties spacingRight(int right)
Parameters:
right - the right spacing
Returns:
this Container.CellProperties for further manipulation.

minSize

public Container.CellProperties minSize(int width,
                                        int height)
Sets the minimum size of the cell.

Parameters:
width - the width
height - the height
Returns:
this Container.CellProperties for further manipulation.

maxSize

public Container.CellProperties maxSize(int width,
                                        int height)
Sets the maximum size of the cell.

Parameters:
width - the width
height - the height
Returns:
this Container.CellProperties for further manipulation.

libgdx API

Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)