|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.badlogic.gdx.scenes.scene2d.Actor
com.badlogic.gdx.scenes.scene2d.Group
com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
com.badlogic.gdx.scenes.scene2d.ui.tablelayout.Table
public class Table
Field Summary | |
---|---|
boolean |
clip
|
boolean |
isPressed
|
Fields inherited from class com.badlogic.gdx.scenes.scene2d.Group |
---|
batchTransform, children, cullingArea, debug, debugTexture, groups, immutableChildren, immutableGroups, lastTouchedChild, localTransform, namesToActors, oldBatchTransform, point, transform, worldTransform |
Fields inherited from class com.badlogic.gdx.scenes.scene2d.Actor |
---|
actions, color, height, name, originX, originY, parent, rotation, scaleX, scaleY, stage, touchable, visible, width, x, y |
Constructor Summary | |
---|---|
Table()
|
|
Table(Skin skin)
|
|
Table(Skin skin,
TableLayout layout,
java.lang.String name)
|
|
Table(java.lang.String name)
|
Method Summary | |
---|---|
Cell |
add()
Adds a cell with a placeholder actor. |
Cell |
add(Actor actor)
Adds a new cell to the table with the specified actor. |
Cell |
add(java.lang.String text)
|
Table |
align(int align)
Alignment of the table within the actor being laid out. |
Table |
align(java.lang.String value)
Alignment of the table within the actor being laid out. |
Table |
bottom()
Sets the alignment of the table within the actor being laid out to Align.BOTTOM . |
Table |
center()
Sets the alignment of the table within the actor being laid out to Align.CENTER . |
void |
clear()
Removes all actors and cells from the table. |
void |
click(float x,
float y)
|
Cell |
columnDefaults(int column)
Gets the cell values that will be used as the defaults for all cells in the specified column. |
Table |
debug()
Turns on all debug lines. |
Table |
debug(int debug)
Turns on debug lines. |
Table |
debug(java.lang.String value)
Turns on debug lines. |
Cell |
defaults()
The cell values that will be used as the defaults for all cells. |
void |
draw(SpriteBatch batch,
float parentAlpha)
If this method is overridden, the super method or WidgetGroup.validate() should be called to ensure the widget group is laid
out. |
protected void |
drawBackground(SpriteBatch batch,
float parentAlpha)
Called to draw the background, before clipping is applied (if enabled). |
static void |
drawDebug(Stage stage)
Draws the debug lines for all TableLayouts in the stage. |
int |
getAlign()
|
java.util.List<Cell> |
getAllCells()
Returns all cells, anywhere in the table hierarchy. |
java.util.List<Cell> |
getAllCells(java.lang.String namePrefix)
Returns all cells with the specified name prefix, anywhere in the table hierarchy. |
NinePatch |
getBackgroundPatch()
|
Cell |
getCell(Actor actor)
Returns the cell for the specified actor, anywhere in the table hierarchy. |
Cell |
getCell(java.lang.String name)
Returns the cell with the specified name, anywhere in the table hierarchy. |
java.util.List<Cell> |
getCells()
Returns the cells for this table. |
ClickListener |
getClickListener()
|
int |
getDebug()
|
java.lang.String |
getHeight()
|
float |
getMinHeight()
|
float |
getMinWidth()
|
java.lang.String |
getPadBottom()
|
java.lang.String |
getPadLeft()
|
java.lang.String |
getPadRight()
|
java.lang.String |
getPadTop()
|
float |
getPrefHeight()
|
float |
getPrefWidth()
|
int |
getRow(float y)
Returns the row index for the y coordinate. |
TableLayout |
getTableLayout()
|
Actor |
getWidget(java.lang.String name)
Returns the widget with the specified name, anywhere in the table hierarchy. |
java.util.List<Actor> |
getWidgets()
Returns all named widgets, anywhere in the table hierarchy. |
java.util.List<Actor> |
getWidgets(java.lang.String namePrefix)
Returns all widgets with the specified name prefix, anywhere in the table hierarchy. |
Table |
height(int height)
The fixed height of the table. |
Table |
height(java.lang.String height)
The fixed height of the table, or null. |
void |
invalidate()
Invalidates this actor's layout, causing Layout.layout() to be called the next time Layout.validate() is called. |
void |
layout()
Positions and sizes children of the actor being laid out using the cell associated with each child. |
Table |
left()
Sets the alignment of the table within the actor being laid out to Align.LEFT . |
Table |
newTable()
Creates a new table with the same Skin and AssetManager as this table. |
Table |
pad(int pad)
Padding around the table. |
Table |
pad(int top,
int left,
int bottom,
int right)
Padding around the table. |
Table |
pad(java.lang.String pad)
Padding around the table. |
Table |
pad(java.lang.String top,
java.lang.String left,
java.lang.String bottom,
java.lang.String right)
Padding around the table. |
Table |
padBottom(int padBottom)
Padding at the bottom of the table. |
Table |
padBottom(java.lang.String padBottom)
Padding at the bottom of the table. |
Table |
padLeft(int padLeft)
Padding at the left of the table. |
Table |
padLeft(java.lang.String padLeft)
Padding at the left of the table. |
Table |
padRight(int padRight)
Padding at the right of the table. |
Table |
padRight(java.lang.String padRight)
Padding at the right of the table. |
Table |
padTop(int padTop)
Padding at the top of the table. |
Table |
padTop(java.lang.String padTop)
Padding at the top of the table. |
void |
parse(FileHandle tableDescriptionFile)
|
void |
parse(java.lang.String tableDescription)
Parses a table description and adds the actors and cells to the table. |
Actor |
register(java.lang.String name,
Actor widget)
|
void |
reset()
Removes all actors and cells from the table (same as clear() ) and additionally resets all table properties and
cell, column, and row defaults. |
Table |
right()
Sets the alignment of the table within the actor being laid out to Align.RIGHT . |
Cell |
row()
Indicates that subsequent cells should be added to a new row and returns the cell values that will be used as the defaults for all cells in the new row. |
void |
setAssetManager(AssetManager assetManager)
|
void |
setBackground(NinePatch background)
Sets the background ninepatch and sets the table's padding to NinePatch.getTopHeight() ,
NinePatch.getBottomHeight() , NinePatch.getLeftWidth() , and NinePatch.getRightWidth() . |
void |
setClickListener(ClickListener listener)
|
void |
setClip(boolean enabled)
Causes the contents to be clipped if they exceed the table bounds. |
void |
setSkin(Skin skin)
|
void |
setWidget(java.lang.String name,
Actor actor)
Sets the actor in the cell with the specified name. |
Table |
size(int width,
int height)
The fixed size of the table. |
Table |
size(java.lang.String width,
java.lang.String height)
The fixed size of the table. |
Cell |
stack(Actor... actor)
Adds a new cell to the table with the specified actors in a Stack . |
Table |
top()
Sets the alignment of the table within the actor being laid out to Align.TOP . |
boolean |
touchDown(float x,
float y,
int pointer)
|
void |
touchUp(float x,
float y,
int pointer)
|
Table |
width(int width)
The fixed width of the table. |
Table |
width(java.lang.String width)
The fixed width of the table, or null. |
Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup |
---|
childrenChanged, getMaxHeight, getMaxWidth, invalidateHierarchy, needsLayout, pack, setFillParent, validate |
Methods inherited from class com.badlogic.gdx.scenes.scene2d.Group |
---|
act, addActor, addActorAfter, addActorAt, addActorBefore, applyTransform, disableDebugging, drawChild, drawChildren, enableDebugging, findActor, getActors, getGroups, hit, isDescendant, removeActor, removeActorRecursive, resetTransform, setCullingArea, sortChildren, swapActor, swapActor, toChildCoordinates, toLocalCoordinates, touchMoved, updateTransform |
Methods inherited from class com.badlogic.gdx.scenes.scene2d.Actor |
---|
action, clearActions, getStage, isMarkedToRemove, keyDown, keyTyped, keyUp, markToRemove, remove, scrolled, toLocalCoordinates, toString, touchDragged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public boolean clip
public boolean isPressed
Constructor Detail |
---|
public Table()
public Table(java.lang.String name)
public Table(Skin skin)
public Table(Skin skin, TableLayout layout, java.lang.String name)
Method Detail |
---|
public void draw(SpriteBatch batch, float parentAlpha)
WidgetGroup
WidgetGroup.validate()
should be called to ensure the widget group is laid
out.
draw
in class WidgetGroup
batch
- the spritebatch to render withparentAlpha
- the parent's alpha value.protected void drawBackground(SpriteBatch batch, float parentAlpha)
public void invalidate()
Layout
Layout.layout()
to be called the next time Layout.validate()
is called. This
should be done 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 float getPrefWidth()
public float getPrefHeight()
public float getMinWidth()
getMinWidth
in interface Layout
getMinWidth
in class WidgetGroup
public float getMinHeight()
getMinHeight
in interface Layout
getMinHeight
in class WidgetGroup
public void setBackground(NinePatch background)
NinePatch.getTopHeight()
,
NinePatch.getBottomHeight()
, NinePatch.getLeftWidth()
, and NinePatch.getRightWidth()
.
background
- If null, no background will be set and all padding is removed.public NinePatch getBackgroundPatch()
public void setClip(boolean enabled)
Group.transform
to true.
public void setClickListener(ClickListener listener)
public ClickListener getClickListener()
public boolean touchDown(float x, float y, int pointer)
touchDown
in class Group
public void touchUp(float x, float y, int pointer)
touchUp
in class Actor
public void click(float x, float y)
public int getRow(float y)
public TableLayout getTableLayout()
public void clear()
clear
in class Group
public Actor register(java.lang.String name, Actor widget)
public Cell add(java.lang.String text)
public Cell add()
public Cell add(Actor actor)
actor
- May be null to add a cell without an actor.TableLayout#add(Actor)
public Cell stack(Actor... actor)
Stack
.
actor
- May be null to add a cell without an actor.TableLayout#stack(Actor...)
public Table newTable()
public Cell row()
TableLayout#row()
public void parse(FileHandle tableDescriptionFile)
public void parse(java.lang.String tableDescription)
TableLayout#parse(String)
public Cell columnDefaults(int column)
TableLayout#columnDefaults(int)
public Cell defaults()
TableLayout#defaults()
public void layout()
layout
in interface Layout
layout
in class WidgetGroup
TableLayout.layout()
public void reset()
clear()
) and additionally resets all table properties and
cell, column, and row defaults.
TableLayout#reset()
public Actor getWidget(java.lang.String name)
public java.util.List<Actor> getWidgets()
public java.util.List<Actor> getWidgets(java.lang.String namePrefix)
public Cell getCell(Actor actor)
TableLayout#getCell(Actor)
public Cell getCell(java.lang.String name)
TableLayout#getCell(String)
public java.util.List<Cell> getAllCells()
TableLayout#getAllCells()
public java.util.List<Cell> getAllCells(java.lang.String namePrefix)
TableLayout#getAllCells(String)
public java.util.List<Cell> getCells()
TableLayout#getCells()
public void setWidget(java.lang.String name, Actor actor)
TableLayout#setWidget(String, Actor)
public Table size(java.lang.String width, java.lang.String height)
TableLayout#size(String, String)
public Table width(java.lang.String width)
TableLayout#width(String)
public Table height(java.lang.String height)
TableLayout#height(String)
public Table size(int width, int height)
TableLayout#size(int, int)
public Table width(int width)
TableLayout#width(int)
public Table height(int height)
TableLayout#height(int)
public Table pad(java.lang.String pad)
TableLayout#pad(String)
public Table pad(java.lang.String top, java.lang.String left, java.lang.String bottom, java.lang.String right)
TableLayout#pad(String, String, String, String)
public Table padTop(java.lang.String padTop)
TableLayout#padTop(String)
public Table padLeft(java.lang.String padLeft)
TableLayout#padLeft(String)
public Table padBottom(java.lang.String padBottom)
TableLayout#padBottom(String)
public Table padRight(java.lang.String padRight)
TableLayout#padRight(String)
public Table pad(int pad)
TableLayout#pad(int)
public Table pad(int top, int left, int bottom, int right)
TableLayout#pad(int, int, int, int)
public Table padTop(int padTop)
TableLayout#padTop(int)
public Table padLeft(int padLeft)
TableLayout#padLeft(int)
public Table padBottom(int padBottom)
TableLayout#padBottom(int)
public Table padRight(int padRight)
TableLayout#padRight(int)
public Table align(int align)
Align.CENTER
, Align.TOP
, Align.BOTTOM
, Align.LEFT
, Align.RIGHT
, or any combination of those.
TableLayout#align(int)
public Table align(java.lang.String value)
TableLayout#align(String)
public Table center()
Align.CENTER
.
TableLayout#center()
public Table top()
Align.TOP
.
TableLayout#top()
public Table left()
Align.LEFT
.
TableLayout#left()
public Table bottom()
Align.BOTTOM
.
TableLayout#bottom()
public Table right()
Align.RIGHT
.
TableLayout#right()
public Table debug()
TableLayout#debug()
public Table debug(int debug)
TableLayout#debug()
public Table debug(java.lang.String value)
TableLayout#debug(String)
public int getDebug()
public java.lang.String getHeight()
public java.lang.String getPadTop()
public java.lang.String getPadLeft()
public java.lang.String getPadBottom()
public java.lang.String getPadRight()
public int getAlign()
public void setSkin(Skin skin)
public void setAssetManager(AssetManager assetManager)
public static void drawDebug(Stage stage)
|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |