com.badlogic.gdx.scenes.scene2d.ui.Table.add()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(333)

本文整理了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

Table.add介绍

[英]Adds a cell without an actor.
[中]添加一个没有参与者的单元格。

代码示例

代码示例来源:origin: libgdx/libgdx

  1. /** Adds the given Label to the content table */
  2. public Dialog text (Label label) {
  3. contentTable.add(label);
  4. return this;
  5. }

代码示例来源:origin: libgdx/libgdx

  1. /** Adds the given Label to the content table */
  2. public Dialog text (Label label) {
  3. contentTable.add(label);
  4. return this;
  5. }

代码示例来源:origin: libgdx/libgdx

  1. /** Adds a cell without an actor. */
  2. public Cell add () {
  3. return add((Actor)null);
  4. }

代码示例来源:origin: libgdx/libgdx

  1. /** Adds a cell without an actor. */
  2. public Cell add () {
  3. return add((Actor)null);
  4. }

代码示例来源:origin: libgdx/libgdx

  1. public void add (Actor... actors) {
  2. for (int i = 0, n = actors.length; i < n; i++)
  3. add(actors[i]);
  4. }

代码示例来源:origin: libgdx/libgdx

  1. /** Adds the given button to the button table.
  2. * @param object The object that will be passed to {@link #result(Object)} if this button is clicked. May be null. */
  3. public Dialog button (Button button, Object object) {
  4. buttonTable.add(button);
  5. setObject(button, object);
  6. return this;
  7. }

代码示例来源:origin: libgdx/libgdx

  1. /** Adds a new cell with a label. This may only be called if {@link Table#Table(Skin)} or {@link #setSkin(Skin)} was used. */
  2. public Cell<Label> add (CharSequence text) {
  3. if (skin == null) throw new IllegalStateException("Table must have a skin set to use this method.");
  4. return add(new Label(text, skin));
  5. }

代码示例来源:origin: libgdx/libgdx

  1. /** Adds the given button to the button table.
  2. * @param object The object that will be passed to {@link #result(Object)} if this button is clicked. May be null. */
  3. public Dialog button (Button button, Object object) {
  4. buttonTable.add(button);
  5. setObject(button, object);
  6. return this;
  7. }

代码示例来源:origin: libgdx/libgdx

  1. /** Adds a new cell with a label. This may only be called if {@link Table#Table(Skin)} or {@link #setSkin(Skin)} was used. */
  2. public Cell<Label> add (CharSequence text) {
  3. if (skin == null) throw new IllegalStateException("Table must have a skin set to use this method.");
  4. return add(new Label(text, skin));
  5. }

代码示例来源:origin: libgdx/libgdx

  1. /** Adds a new cell with a label. This may only be called if {@link Table#Table(Skin)} or {@link #setSkin(Skin)} was used. */
  2. public Cell<Label> add (CharSequence text, String labelStyleName) {
  3. if (skin == null) throw new IllegalStateException("Table must have a skin set to use this method.");
  4. return add(new Label(text, skin.get(labelStyleName, LabelStyle.class)));
  5. }

代码示例来源:origin: libgdx/libgdx

  1. /** Adds a new cell with a label. This may only be called if {@link Table#Table(Skin)} or {@link #setSkin(Skin)} was used. */
  2. public Cell<Label> add (CharSequence text, String labelStyleName) {
  3. if (skin == null) throw new IllegalStateException("Table must have a skin set to use this method.");
  4. return add(new Label(text, skin.get(labelStyleName, LabelStyle.class)));
  5. }

代码示例来源:origin: libgdx/libgdx

  1. /** Adds a new cell to the table with the specified actors in a {@link Stack}.
  2. * @param actors May be null to add a stack without any actors. */
  3. public Cell<Stack> stack (Actor... actors) {
  4. Stack stack = new Stack();
  5. if (actors != null) {
  6. for (int i = 0, n = actors.length; i < n; i++)
  7. stack.addActor(actors[i]);
  8. }
  9. return add(stack);
  10. }

代码示例来源:origin: libgdx/libgdx

  1. /** Adds a new cell to the table with the specified actors in a {@link Stack}.
  2. * @param actors May be null to add a stack without any actors. */
  3. public Cell<Stack> stack (Actor... actors) {
  4. Stack stack = new Stack();
  5. if (actors != null) {
  6. for (int i = 0, n = actors.length; i < n; i++)
  7. stack.addActor(actors[i]);
  8. }
  9. return add(stack);
  10. }

代码示例来源:origin: libgdx/libgdx

  1. /** Adds a new cell with a label. This may only be called if {@link Table#Table(Skin)} or {@link #setSkin(Skin)} was used. */
  2. public Cell<Label> add (CharSequence text, String fontName, Color color) {
  3. if (skin == null) throw new IllegalStateException("Table must have a skin set to use this method.");
  4. return add(new Label(text, new LabelStyle(skin.getFont(fontName), color)));
  5. }

代码示例来源:origin: libgdx/libgdx

  1. /** Adds a new cell with a label. This may only be called if {@link Table#Table(Skin)} or {@link #setSkin(Skin)} was used. */
  2. public Cell<Label> add (CharSequence text, String fontName, Color color) {
  3. if (skin == null) throw new IllegalStateException("Table must have a skin set to use this method.");
  4. return add(new Label(text, new LabelStyle(skin.getFont(fontName), color)));
  5. }

代码示例来源:origin: libgdx/libgdx

  1. /** Adds a new cell with a label. This may only be called if {@link Table#Table(Skin)} or {@link #setSkin(Skin)} was used. */
  2. public Cell<Label> add (CharSequence text, String fontName, String colorName) {
  3. if (skin == null) throw new IllegalStateException("Table must have a skin set to use this method.");
  4. return add(new Label(text, new LabelStyle(skin.getFont(fontName), skin.getColor(colorName))));
  5. }

代码示例来源:origin: libgdx/libgdx

  1. /** Adds a new cell with a label. This may only be called if {@link Table#Table(Skin)} or {@link #setSkin(Skin)} was used. */
  2. public Cell<Label> add (CharSequence text, String fontName, String colorName) {
  3. if (skin == null) throw new IllegalStateException("Table must have a skin set to use this method.");
  4. return add(new Label(text, new LabelStyle(skin.getFont(fontName), skin.getColor(colorName))));
  5. }

代码示例来源:origin: libgdx/libgdx

  1. Table label (String text) {
  2. Table table = new Table().debug();
  3. table.add(new Label(text, skin)).fill().expand();
  4. return table;
  5. }

代码示例来源:origin: libgdx/libgdx

  1. private void setupUI () {
  2. Skin skin = assets.get(DEFAULT_SKIN);
  3. Table table = new Table();
  4. table.setFillParent(true);
  5. table.top().left().add(new Label("FPS ", skin)).left();
  6. table.add(fpsLabel = new Label("", skin)).left().expandX().row();
  7. ui.addActor(table);
  8. }

代码示例来源:origin: libgdx/libgdx

  1. @Override
  2. public void create () {
  3. skin = new Skin(Gdx.files.internal("data/uiskin.json"));
  4. image2 = new TextureRegion(new Texture(Gdx.files.internal("data/badlogic.jpg")));
  5. ui = new Stage();
  6. Gdx.input.setInputProcessor(ui);
  7. root = new Table();
  8. root.setSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
  9. ui.addActor(root);
  10. root.debug();
  11. Image image = new Image(image2);
  12. image.setScaling(Scaling.fill);
  13. root.add(image).width(image2.getRegionWidth()).height(image2.getRegionHeight());
  14. }

相关文章