public class Padding
extends java.lang.Object
When padding is set for a table, its cells will be separated from its borders by the given value. When padding is set for a window, additionally to the table's padding effect, top padding will be a draggable area, allowing to move the window.
When padding is set for a cell, it will be separated from other cells and table's border by the given value. When spacing is set for a cell, it will be separated by at least as many pixels from other cells as specified. If spacing or padding with the same values is used on every cell in a table, padding will provide twice as big distances between cells, since spacings can overlap.
Modifier and Type | Field and Description |
---|---|
static Padding |
PAD_0
Common padding sizes.
|
static Padding |
PAD_2
Common padding sizes.
|
static Padding |
PAD_4
Common padding sizes.
|
static Padding |
PAD_8
Common padding sizes.
|
Constructor and Description |
---|
Padding(float padding) |
Padding(float horizontal,
float vertical) |
Padding(float top,
float left,
float bottom,
float right) |
Modifier and Type | Method and Description |
---|---|
Padding |
add(Padding padding) |
com.badlogic.gdx.scenes.scene2d.ui.Cell<?> |
applyPadding(com.badlogic.gdx.scenes.scene2d.ui.Cell<?> cell)
Allows to set Cell's padding with the Padding object, which has be done externally, as it's not part of
the standard libGDX API.
|
com.badlogic.gdx.scenes.scene2d.ui.Table |
applyPadding(com.badlogic.gdx.scenes.scene2d.ui.Table table)
Allows to set Table's padding with the Padding object, which has be done externally, as it's not part
of the standard libGDX API.
|
com.badlogic.gdx.scenes.scene2d.ui.Cell<?> |
applySpacing(com.badlogic.gdx.scenes.scene2d.ui.Cell<?> cell)
Allows to set Cell's spacing with the Padding object, which has be done externally, as it's not part of
the standard libGDX API.
|
float |
getBottom() |
float |
getLeft() |
float |
getRight() |
float |
getTop() |
static Padding |
of(float padding) |
static Padding |
of(float horizontal,
float vertical) |
static Padding |
of(float top,
float left,
float bottom,
float right) |
Padding |
reverse() |
static com.badlogic.gdx.scenes.scene2d.ui.Cell<?> |
setPadding(Padding padding,
com.badlogic.gdx.scenes.scene2d.ui.Cell<?> cell)
Allows to set Cell's padding with the Padding object, which has be done externally, as it's not part of
the standard libGDX API.
|
static com.badlogic.gdx.scenes.scene2d.ui.Table |
setPadding(Padding padding,
com.badlogic.gdx.scenes.scene2d.ui.Table table)
Allows to set Table's padding with the Padding object, which has be done externally, as it's not part
of the standard libGDX API.
|
static com.badlogic.gdx.scenes.scene2d.ui.Cell<?> |
setSpacing(Padding spacing,
com.badlogic.gdx.scenes.scene2d.ui.Cell<?> cell)
Allows to set Cell's spacing with the Padding object, which has be done externally, as it's not part of
the standard libGDX API.
|
Padding |
subtract(Padding padding) |
public static final Padding PAD_0
public static final Padding PAD_2
public static final Padding PAD_4
public static final Padding PAD_8
public Padding(float padding)
padding
- will be set as padding for all directions.public Padding(float horizontal, float vertical)
horizontal
- will be set as left and right padding.vertical
- will be set as top and bottom padding.public Padding(float top, float left, float bottom, float right)
top
- top padding value.left
- left padding value.bottom
- bottom padding value.right
- right padding value.public static Padding of(float padding)
padding
- will be set as padding for all directions.public static Padding of(float horizontal, float vertical)
horizontal
- will be set as left and right padding.vertical
- will be set as top and bottom padding.public static Padding of(float top, float left, float bottom, float right)
top
- top padding value.left
- left padding value.bottom
- bottom padding value.right
- right padding value.public float getTop()
public float getLeft()
public float getBottom()
public float getRight()
public Padding add(Padding padding)
padding
- will be added to the given padding.public Padding subtract(Padding padding)
padding
- will be subtracted from the given padding.public Padding reverse()
public com.badlogic.gdx.scenes.scene2d.ui.Table applyPadding(com.badlogic.gdx.scenes.scene2d.ui.Table table)
table
- will have the padding set according to the this object's data.public com.badlogic.gdx.scenes.scene2d.ui.Cell<?> applyPadding(com.badlogic.gdx.scenes.scene2d.ui.Cell<?> cell)
cell
- will have the padding set according to the this object's data.public com.badlogic.gdx.scenes.scene2d.ui.Cell<?> applySpacing(com.badlogic.gdx.scenes.scene2d.ui.Cell<?> cell)
cell
- will have the padding set according to the this object's data.public static com.badlogic.gdx.scenes.scene2d.ui.Table setPadding(Padding padding, com.badlogic.gdx.scenes.scene2d.ui.Table table)
padding
- contains data of padding sizes.table
- will have the padding set according to the given data.public static com.badlogic.gdx.scenes.scene2d.ui.Cell<?> setPadding(Padding padding, com.badlogic.gdx.scenes.scene2d.ui.Cell<?> cell)
padding
- contains data of padding sizes.cell
- will have the padding set according to the given data.public static com.badlogic.gdx.scenes.scene2d.ui.Cell<?> setSpacing(Padding spacing, com.badlogic.gdx.scenes.scene2d.ui.Cell<?> cell)
spacing
- contains data of spacing sizes.cell
- will have the padding set according to the given data.