本文整理了Java中com.badlogic.gdx.scenes.scene2d.ui.Table.add()
方法的一些代码示例,展示了Table.add()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.add()
方法的具体详情如下:
包路径:com.badlogic.gdx.scenes.scene2d.ui.Table
类名称:Table
方法名:add
[英]Adds a cell without an actor.
[中]添加一个没有参与者的单元格。
代码示例来源:origin: libgdx/libgdx
/** Adds the given Label to the content table */
public Dialog text (Label label) {
contentTable.add(label);
return this;
}
代码示例来源:origin: libgdx/libgdx
/** Adds the given Label to the content table */
public Dialog text (Label label) {
contentTable.add(label);
return this;
}
代码示例来源:origin: libgdx/libgdx
/** Adds a cell without an actor. */
public Cell add () {
return add((Actor)null);
}
代码示例来源:origin: libgdx/libgdx
/** Adds a cell without an actor. */
public Cell add () {
return add((Actor)null);
}
代码示例来源:origin: libgdx/libgdx
public void add (Actor... actors) {
for (int i = 0, n = actors.length; i < n; i++)
add(actors[i]);
}
代码示例来源:origin: libgdx/libgdx
/** Adds the given button to the button table.
* @param object The object that will be passed to {@link #result(Object)} if this button is clicked. May be null. */
public Dialog button (Button button, Object object) {
buttonTable.add(button);
setObject(button, object);
return this;
}
代码示例来源:origin: libgdx/libgdx
/** Adds a new cell with a label. This may only be called if {@link Table#Table(Skin)} or {@link #setSkin(Skin)} was used. */
public Cell<Label> add (CharSequence text) {
if (skin == null) throw new IllegalStateException("Table must have a skin set to use this method.");
return add(new Label(text, skin));
}
代码示例来源:origin: libgdx/libgdx
/** Adds the given button to the button table.
* @param object The object that will be passed to {@link #result(Object)} if this button is clicked. May be null. */
public Dialog button (Button button, Object object) {
buttonTable.add(button);
setObject(button, object);
return this;
}
代码示例来源:origin: libgdx/libgdx
/** Adds a new cell with a label. This may only be called if {@link Table#Table(Skin)} or {@link #setSkin(Skin)} was used. */
public Cell<Label> add (CharSequence text) {
if (skin == null) throw new IllegalStateException("Table must have a skin set to use this method.");
return add(new Label(text, skin));
}
代码示例来源:origin: libgdx/libgdx
/** Adds a new cell with a label. This may only be called if {@link Table#Table(Skin)} or {@link #setSkin(Skin)} was used. */
public Cell<Label> add (CharSequence text, String labelStyleName) {
if (skin == null) throw new IllegalStateException("Table must have a skin set to use this method.");
return add(new Label(text, skin.get(labelStyleName, LabelStyle.class)));
}
代码示例来源:origin: libgdx/libgdx
/** Adds a new cell with a label. This may only be called if {@link Table#Table(Skin)} or {@link #setSkin(Skin)} was used. */
public Cell<Label> add (CharSequence text, String labelStyleName) {
if (skin == null) throw new IllegalStateException("Table must have a skin set to use this method.");
return add(new Label(text, skin.get(labelStyleName, LabelStyle.class)));
}
代码示例来源:origin: libgdx/libgdx
/** Adds a new cell to the table with the specified actors in a {@link Stack}.
* @param actors May be null to add a stack without any actors. */
public Cell<Stack> stack (Actor... actors) {
Stack stack = new Stack();
if (actors != null) {
for (int i = 0, n = actors.length; i < n; i++)
stack.addActor(actors[i]);
}
return add(stack);
}
代码示例来源:origin: libgdx/libgdx
/** Adds a new cell to the table with the specified actors in a {@link Stack}.
* @param actors May be null to add a stack without any actors. */
public Cell<Stack> stack (Actor... actors) {
Stack stack = new Stack();
if (actors != null) {
for (int i = 0, n = actors.length; i < n; i++)
stack.addActor(actors[i]);
}
return add(stack);
}
代码示例来源:origin: libgdx/libgdx
/** Adds a new cell with a label. This may only be called if {@link Table#Table(Skin)} or {@link #setSkin(Skin)} was used. */
public Cell<Label> add (CharSequence text, String fontName, Color color) {
if (skin == null) throw new IllegalStateException("Table must have a skin set to use this method.");
return add(new Label(text, new LabelStyle(skin.getFont(fontName), color)));
}
代码示例来源:origin: libgdx/libgdx
/** Adds a new cell with a label. This may only be called if {@link Table#Table(Skin)} or {@link #setSkin(Skin)} was used. */
public Cell<Label> add (CharSequence text, String fontName, Color color) {
if (skin == null) throw new IllegalStateException("Table must have a skin set to use this method.");
return add(new Label(text, new LabelStyle(skin.getFont(fontName), color)));
}
代码示例来源:origin: libgdx/libgdx
/** Adds a new cell with a label. This may only be called if {@link Table#Table(Skin)} or {@link #setSkin(Skin)} was used. */
public Cell<Label> add (CharSequence text, String fontName, String colorName) {
if (skin == null) throw new IllegalStateException("Table must have a skin set to use this method.");
return add(new Label(text, new LabelStyle(skin.getFont(fontName), skin.getColor(colorName))));
}
代码示例来源:origin: libgdx/libgdx
/** Adds a new cell with a label. This may only be called if {@link Table#Table(Skin)} or {@link #setSkin(Skin)} was used. */
public Cell<Label> add (CharSequence text, String fontName, String colorName) {
if (skin == null) throw new IllegalStateException("Table must have a skin set to use this method.");
return add(new Label(text, new LabelStyle(skin.getFont(fontName), skin.getColor(colorName))));
}
代码示例来源:origin: libgdx/libgdx
Table label (String text) {
Table table = new Table().debug();
table.add(new Label(text, skin)).fill().expand();
return table;
}
代码示例来源:origin: libgdx/libgdx
private void setupUI () {
Skin skin = assets.get(DEFAULT_SKIN);
Table table = new Table();
table.setFillParent(true);
table.top().left().add(new Label("FPS ", skin)).left();
table.add(fpsLabel = new Label("", skin)).left().expandX().row();
ui.addActor(table);
}
代码示例来源:origin: libgdx/libgdx
@Override
public void create () {
skin = new Skin(Gdx.files.internal("data/uiskin.json"));
image2 = new TextureRegion(new Texture(Gdx.files.internal("data/badlogic.jpg")));
ui = new Stage();
Gdx.input.setInputProcessor(ui);
root = new Table();
root.setSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
ui.addActor(root);
root.debug();
Image image = new Image(image2);
image.setScaling(Scaling.fill);
root.add(image).width(image2.getRegionWidth()).height(image2.getRegionHeight());
}
内容来源于网络,如有侵权,请联系作者删除!