C# Класс Nez.UI.Table

A group that sizes and positions children using table constraints. By default, {@link #getTouchable()} is {@link Touchable#childrenOnly}. The preferred and minimum sizes are that of the chdebugn when laid out in columns and rows.
Наследование: Group
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
backgroundBottom Value
backgroundLeft Value
backgroundRight Value
backgroundTop Value
clip bool
debugCellColor Color
debugElementColor Color
debugTableColor Color

Защищенные свойства (Protected)

Свойство Тип Описание
_background IDrawable

Открытые методы

Метод Описание
Table ( ) : System
add ( ) : Cell

Adds a cell without an element

add ( Element element ) : Cell

Adds a new cell to the table with the specified element.

add ( string text ) : Cell

Adds a new cell with a label

addDebugRect ( float x, float y, float w, float h, Color color ) : void
align ( int align ) : Table

Alignment of the logical table within the table element. Set to {@link Align#center}, {@link Align#top}, {@link Align#bottom} {@link Align#left}, {@link Align#right}, or any combination of those.

bottom ( ) : Table

Adds {@link Align#bottom} and clears {@link Align#top} for the alignment of the logical table within the table element.

center ( ) : Table

Sets the alignment of the logical table within the table element to {@link Align#center}. This clears any other alignment.

clearChildren ( ) : void

Removes all elements and cells from the table

computeDebugRects ( float x, float y, float layoutX, float layoutY, float layoutWidth, float layoutHeight, float tableWidth, float tableHeight, float hpadding, float vpadding ) : void
computeSize ( ) : void
debugAll ( ) : Table

Turn on all debug lines (table, cell, and element)

debugCell ( ) : Table

Turns on cell debug lines.

debugElement ( ) : Table

Turns on element debug lines.

debugRender ( Graphics graphics ) : void
debugTable ( ) : Table

Turns on table debug lines.

defaults ( ) : Cell

The cell values that will be used as the defaults for all cells.

draw ( Graphics graphics, float parentAlpha ) : void
endRow ( ) : void
getAlign ( ) : int
getBackground ( ) : IDrawable
getCell ( Element element ) : Cell

Returns the cell for the specified element in this table, or null.

getCells ( ) : List

returns all the Cells in the table

getColumnDefaults ( int column ) : Cell

Gets the cell values that will be used as the defaults for all cells in the specified column. Columns are indexed starting at 0

getColumnWidth ( int columnIndex ) : float

Returns the width of the specified column.

getColumns ( ) : int
getPadBottom ( ) : float
getPadBottomValue ( ) : Value
getPadLeft ( ) : float
getPadLeftValue ( ) : Value
getPadRight ( ) : float
getPadRightValue ( ) : Value
getPadTop ( ) : float
getPadTopValue ( ) : Value
getPadX ( ) : float

Returns {@link #getPadLeft()} plus {@link #getPadRight()}.

getPadY ( ) : float

Returns {@link #getPadTop()} plus {@link #getPadBottom()}.

getRowDefaults ( ) : Cell

gets the current Cell defaults. This is the same value returned by a call to row()

getRowHeight ( int rowIndex ) : float

Returns the height of the specified row.

getRows ( ) : int
hit ( Vector2 point ) : Element
invalidate ( ) : void
layout ( ) : void
layout ( float layoutX, float layoutY, float layoutWidth, float layoutHeight ) : void

Positions and sizes children of the table using the cell associated with each child. The values given are the position within the parent and size of the table.

left ( ) : Table

Adds {@link Align#left} and clears {@link Align#right} for the alignment of the logical table within the table element.

pad ( Value pad ) : Table

Sets the padTop, padLeft, padBottom, and padRight around the table to the specified value.

pad ( Value top, Value left, Value bottom, Value right ) : Table
pad ( float pad ) : Table

Sets the padTop, padLeft, padBottom, and padRight around the table to the specified value.

pad ( float top, float left, float bottom, float right ) : Table
padBottom ( Value padBottom ) : Table

Padding at the bottom edge of the table.

padBottom ( float padBottom ) : Table

Padding at the bottom edge of the table.

padLeft ( Value padLeft ) : Table

Padding at the left edge of the table.

padLeft ( float padLeft ) : Table

Padding at the left edge of the table.

padRight ( Value padRight ) : Table

Padding at the right edge of the table.

padRight ( float padRight ) : Table

Padding at the right edge of the table.

padTop ( Value padTop ) : Table

Padding at the top edge of the table.

padTop ( float padTop ) : Table

Padding at the top edge of the table.

removeElement ( Element element ) : bool
reset ( ) : void

Removes all elements and cells from the table (same as {@link #clear()}) and additionally resets all table properties and cell, column, and row defaults.

right ( ) : Table

Adds {@link Align#right} and clears {@link Align#left} for the alignment of the logical table within the table element.

round ( bool round ) : Table

If true (the default), positions and sizes are rounded to integers.

row ( ) : Cell

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.

setBackground ( IDrawable background ) : Table

background may be null to clear the background.

setDebug ( bool enabled ) : void

enables/disables all debug lines (table, cell, and widget)

setFillParent ( bool fillParent ) : Table
stack ( ) : Cell

Adds a new cell to the table with the specified elements in a {@link Stack}.

tableDebug ( TableDebug tableDebug ) : Table

Turns debug lines on or off.

top ( ) : Table

Adds {@link Align#top} and clears {@link Align#bottom} for the alignment of the logical table within the table element.

Защищенные методы

Метод Описание
drawBackground ( Graphics graphics, float parentAlpha, float x, float y ) : void

Called to draw the background, before clipping is applied (if enabled). Default implementation draws the background drawable.

Приватные методы

Метод Описание
ensureSize ( float array, int size ) : float[]
obtainCell ( ) : Cell

Описание методов

Table() публичный Метод

public Table ( ) : System
Результат System

add() публичный Метод

Adds a cell without an element
public add ( ) : Cell
Результат Cell

add() публичный Метод

Adds a new cell to the table with the specified element.
public add ( Element element ) : Cell
element Element element.
Результат Cell

add() публичный Метод

Adds a new cell with a label
public add ( string text ) : Cell
text string Text.
Результат Cell

addDebugRect() публичный Метод

public addDebugRect ( float x, float y, float w, float h, Color color ) : void
x float
y float
w float
h float
color Color
Результат void

align() публичный Метод

Alignment of the logical table within the table element. Set to {@link Align#center}, {@link Align#top}, {@link Align#bottom} {@link Align#left}, {@link Align#right}, or any combination of those.
public align ( int align ) : Table
align int Align.
Результат Table

bottom() публичный Метод

Adds {@link Align#bottom} and clears {@link Align#top} for the alignment of the logical table within the table element.
public bottom ( ) : Table
Результат Table

center() публичный Метод

Sets the alignment of the logical table within the table element to {@link Align#center}. This clears any other alignment.
public center ( ) : Table
Результат Table

clearChildren() публичный Метод

Removes all elements and cells from the table
public clearChildren ( ) : void
Результат void

computeDebugRects() публичный Метод

public computeDebugRects ( float x, float y, float layoutX, float layoutY, float layoutWidth, float layoutHeight, float tableWidth, float tableHeight, float hpadding, float vpadding ) : void
x float
y float
layoutX float
layoutY float
layoutWidth float
layoutHeight float
tableWidth float
tableHeight float
hpadding float
vpadding float
Результат void

computeSize() публичный Метод

public computeSize ( ) : void
Результат void

debugAll() публичный Метод

Turn on all debug lines (table, cell, and element)
public debugAll ( ) : Table
Результат Table

debugCell() публичный Метод

Turns on cell debug lines.
public debugCell ( ) : Table
Результат Table

debugElement() публичный Метод

Turns on element debug lines.
public debugElement ( ) : Table
Результат Table

debugRender() публичный Метод

public debugRender ( Graphics graphics ) : void
graphics Graphics
Результат void

debugTable() публичный Метод

Turns on table debug lines.
public debugTable ( ) : Table
Результат Table

defaults() публичный Метод

The cell values that will be used as the defaults for all cells.
public defaults ( ) : Cell
Результат Cell

draw() публичный Метод

public draw ( Graphics graphics, float parentAlpha ) : void
graphics Graphics
parentAlpha float
Результат void

drawBackground() защищенный Метод

Called to draw the background, before clipping is applied (if enabled). Default implementation draws the background drawable.
protected drawBackground ( Graphics graphics, float parentAlpha, float x, float y ) : void
graphics Graphics Graphics.
parentAlpha float Parent alpha.
x float The x coordinate.
y float The y coordinate.
Результат void

endRow() публичный Метод

public endRow ( ) : void
Результат void

getAlign() публичный Метод

public getAlign ( ) : int
Результат int

getBackground() публичный Метод

public getBackground ( ) : IDrawable
Результат IDrawable

getCell() публичный Метод

Returns the cell for the specified element in this table, or null.
public getCell ( Element element ) : Cell
element Element element.
Результат Cell

getCells() публичный Метод

returns all the Cells in the table
public getCells ( ) : List
Результат List

getColumnDefaults() публичный Метод

Gets the cell values that will be used as the defaults for all cells in the specified column. Columns are indexed starting at 0
public getColumnDefaults ( int column ) : Cell
column int Column.
Результат Cell

getColumnWidth() публичный Метод

Returns the width of the specified column.
public getColumnWidth ( int columnIndex ) : float
columnIndex int Column index.
Результат float

getColumns() публичный Метод

public getColumns ( ) : int
Результат int

getPadBottom() публичный Метод

public getPadBottom ( ) : float
Результат float

getPadBottomValue() публичный Метод

public getPadBottomValue ( ) : Value
Результат Value

getPadLeft() публичный Метод

public getPadLeft ( ) : float
Результат float

getPadLeftValue() публичный Метод

public getPadLeftValue ( ) : Value
Результат Value

getPadRight() публичный Метод

public getPadRight ( ) : float
Результат float

getPadRightValue() публичный Метод

public getPadRightValue ( ) : Value
Результат Value

getPadTop() публичный Метод

public getPadTop ( ) : float
Результат float

getPadTopValue() публичный Метод

public getPadTopValue ( ) : Value
Результат Value

getPadX() публичный Метод

Returns {@link #getPadLeft()} plus {@link #getPadRight()}.
public getPadX ( ) : float
Результат float

getPadY() публичный Метод

Returns {@link #getPadTop()} plus {@link #getPadBottom()}.
public getPadY ( ) : float
Результат float

getRowDefaults() публичный Метод

gets the current Cell defaults. This is the same value returned by a call to row()
public getRowDefaults ( ) : Cell
Результат Cell

getRowHeight() публичный Метод

Returns the height of the specified row.
public getRowHeight ( int rowIndex ) : float
rowIndex int Row index.
Результат float

getRows() публичный Метод

public getRows ( ) : int
Результат int

hit() публичный Метод

public hit ( Vector2 point ) : Element
point Vector2
Результат Element

invalidate() публичный Метод

public invalidate ( ) : void
Результат void

layout() публичный Метод

public layout ( ) : void
Результат void

layout() публичный Метод

Positions and sizes children of the table using the cell associated with each child. The values given are the position within the parent and size of the table.
public layout ( float layoutX, float layoutY, float layoutWidth, float layoutHeight ) : void
layoutX float Layout x.
layoutY float Layout y.
layoutWidth float Layout width.
layoutHeight float Layout height.
Результат void

left() публичный Метод

Adds {@link Align#left} and clears {@link Align#right} for the alignment of the logical table within the table element.
public left ( ) : Table
Результат Table

pad() публичный Метод

Sets the padTop, padLeft, padBottom, and padRight around the table to the specified value.
public pad ( Value pad ) : Table
pad Value Pad.
Результат Table

pad() публичный Метод

public pad ( Value top, Value left, Value bottom, Value right ) : Table
top Value
left Value
bottom Value
right Value
Результат Table

pad() публичный Метод

Sets the padTop, padLeft, padBottom, and padRight around the table to the specified value.
public pad ( float pad ) : Table
pad float Pad.
Результат Table

pad() публичный Метод

public pad ( float top, float left, float bottom, float right ) : Table
top float
left float
bottom float
right float
Результат Table

padBottom() публичный Метод

Padding at the bottom edge of the table.
public padBottom ( Value padBottom ) : Table
padBottom Value Pad bottom.
Результат Table

padBottom() публичный Метод

Padding at the bottom edge of the table.
public padBottom ( float padBottom ) : Table
padBottom float Pad bottom.
Результат Table

padLeft() публичный Метод

Padding at the left edge of the table.
public padLeft ( Value padLeft ) : Table
padLeft Value Pad left.
Результат Table

padLeft() публичный Метод

Padding at the left edge of the table.
public padLeft ( float padLeft ) : Table
padLeft float Pad left.
Результат Table

padRight() публичный Метод

Padding at the right edge of the table.
public padRight ( Value padRight ) : Table
padRight Value Pad right.
Результат Table

padRight() публичный Метод

Padding at the right edge of the table.
public padRight ( float padRight ) : Table
padRight float Pad right.
Результат Table

padTop() публичный Метод

Padding at the top edge of the table.
public padTop ( Value padTop ) : Table
padTop Value Pad top.
Результат Table

padTop() публичный Метод

Padding at the top edge of the table.
public padTop ( float padTop ) : Table
padTop float Pad top.
Результат Table

removeElement() публичный Метод

public removeElement ( Element element ) : bool
element Element
Результат bool

reset() публичный Метод

Removes all elements and cells from the table (same as {@link #clear()}) and additionally resets all table properties and cell, column, and row defaults.
public reset ( ) : void
Результат void

right() публичный Метод

Adds {@link Align#right} and clears {@link Align#left} for the alignment of the logical table within the table element.
public right ( ) : Table
Результат Table

round() публичный Метод

If true (the default), positions and sizes are rounded to integers.
public round ( bool round ) : Table
round bool If set to true round.
Результат Table

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.
public row ( ) : Cell
Результат Cell

setBackground() публичный Метод

background may be null to clear the background.
public setBackground ( IDrawable background ) : Table
background IDrawable Background.
Результат Table

setDebug() публичный Метод

enables/disables all debug lines (table, cell, and widget)
public setDebug ( bool enabled ) : void
enabled bool If set to true enabled.
Результат void

setFillParent() публичный Метод

public setFillParent ( bool fillParent ) : Table
fillParent bool
Результат Table

stack() публичный Метод

Adds a new cell to the table with the specified elements in a {@link Stack}.
public stack ( ) : Cell
Результат Cell

tableDebug() публичный Метод

Turns debug lines on or off.
public tableDebug ( TableDebug tableDebug ) : Table
tableDebug TableDebug Table debug.
Результат Table

top() публичный Метод

Adds {@link Align#top} and clears {@link Align#bottom} for the alignment of the logical table within the table element.
public top ( ) : Table
Результат Table

Описание свойств

_background защищенное свойство

protected IDrawable _background
Результат IDrawable

backgroundBottom статическое публичное свойство

static public Value,Nez.UI backgroundBottom
Результат Value

backgroundLeft статическое публичное свойство

static public Value,Nez.UI backgroundLeft
Результат Value

backgroundRight статическое публичное свойство

static public Value,Nez.UI backgroundRight
Результат Value

backgroundTop статическое публичное свойство

static public Value,Nez.UI backgroundTop
Результат Value

clip публичное свойство

public bool clip
Результат bool

debugCellColor статическое публичное свойство

static public Color debugCellColor
Результат Color

debugElementColor статическое публичное свойство

static public Color debugElementColor
Результат Color

debugTableColor статическое публичное свойство

static public Color debugTableColor
Результат Color