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

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

本文整理了Java中com.badlogic.gdx.scenes.scene2d.ui.Table.setFillParent()方法的一些代码示例,展示了Table.setFillParent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.setFillParent()方法的具体详情如下:
包路径:com.badlogic.gdx.scenes.scene2d.ui.Table
类名称:Table
方法名:setFillParent

Table.setFillParent介绍

暂无

代码示例

代码示例来源: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. public void create () {
  2. stage = new Stage();
  3. Gdx.input.setInputProcessor(stage);
  4. root = new Table();
  5. root.setFillParent(true);
  6. stage.addActor(root);
  7. skin = new Skin(Gdx.files.internal("data/uiskin.json"));
  8. Table labels = new Table();
  9. root.add(new ScrollPane(labels, skin)).expand().fill();
  10. root.row();
  11. root.add(drawnLabel = new Label("", skin));
  12. for (int i = 0; i < count; i++) {
  13. labels.add(new Label("Label: " + i, skin) {
  14. public void draw (Batch batch, float parentAlpha) {
  15. super.draw(batch, parentAlpha);
  16. drawn++;
  17. }
  18. });
  19. labels.row();
  20. }
  21. }

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

  1. public void setupUI () {
  2. ui = new Stage();
  3. skin = new Skin(Gdx.files.internal("data/uiskin.json"));
  4. TextButton reload = new TextButton("Reload Shaders", skin.get(TextButtonStyle.class));
  5. camera = new SelectBox(skin.get(SelectBoxStyle.class));
  6. camera.setItems("Camera", "Light");
  7. fps = new Label("fps: ", skin.get(LabelStyle.class));
  8. Table table = new Table();
  9. table.setFillParent(true);
  10. table.top().padTop(15);
  11. table.add(reload).spaceRight(5);
  12. table.add(camera).spaceRight(5);
  13. table.add(fps);
  14. ui.addActor(table);
  15. reload.addListener(new ClickListener() {
  16. public void clicked (InputEvent event, float x, float y) {
  17. ShaderProgram prog = new ShaderProgram(Gdx.files.internal("data/shaders/projtex-vert.glsl").readString(), Gdx.files
  18. .internal("data/shaders/projtex-frag.glsl").readString());
  19. if (prog.isCompiled() == false) {
  20. Gdx.app.log("GLSL ERROR", "Couldn't reload shaders:\n" + prog.getLog());
  21. } else {
  22. projTexShader.dispose();
  23. projTexShader = prog;
  24. }
  25. }
  26. });
  27. }

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

  1. stage.addActor(container);
  2. container.setFillParent(true);
  3. container.pad(10).defaults().expandX().fillX().space(4);

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

  1. private void setupUI () {
  2. ui = new Stage(new ExtendViewport(640, 480));
  3. Skin skin = new Skin(Gdx.files.internal("data/uiskin.json"));
  4. skipCleanup = new CheckBox("Skip blend function clean-up", skin);
  5. skipCleanup.addListener(listener);
  6. logLabel = new Label("", skin.get(LabelStyle.class));
  7. clearEmitters = new TextButton("Clear screen", skin);
  8. clearEmitters.addListener(listener);
  9. scaleEffects = new TextButton("Scale existing effects", skin);
  10. scaleEffects.addListener(listener);
  11. Table table = new Table();
  12. table.setTransform(false);
  13. table.setFillParent(true);
  14. table.defaults().padTop(5).left();
  15. table.top().left().padLeft(5);
  16. table.add(skipCleanup).colspan(2).row();
  17. table.add(clearEmitters).spaceRight(10);
  18. table.add(scaleEffects).row();
  19. table.add(logLabel).colspan(2);
  20. ui.addActor(table);
  21. }

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

  1. table2.setFillParent(true);
  2. table2.bottom();

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

  1. public void create () {
  2. stage = new Stage();
  3. Gdx.input.setInputProcessor(stage);
  4. Skin skin = new Skin(Gdx.files.internal("data/uiskin.json"));
  5. Table table = new Table();
  6. table.setFillParent(true);
  7. stage.addActor(table);
  8. final Tree tree = new Tree(skin);
  9. final Node moo1 = new Node(new TextButton("moo1", skin));
  10. final Node moo2 = new Node(new TextButton("moo2", skin));
  11. final Node moo3 = new Node(new TextButton("moo3", skin));
  12. final Node moo4 = new Node(new TextButton("moo4", skin));
  13. final Node moo5 = new Node(new TextButton("moo5", skin));
  14. tree.add(moo1);
  15. tree.add(moo2);
  16. moo2.add(moo3);
  17. moo3.add(moo4);
  18. tree.add(moo5);
  19. moo5.getActor().addListener(new ClickListener() {
  20. public void clicked (InputEvent event, float x, float y) {
  21. tree.remove(moo4);
  22. }
  23. });
  24. table.add(tree).fill().expand();
  25. }

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

  1. table.setFillParent(true);
  2. stage.addActor(table);

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

  1. public void create () {
  2. stage = new Stage();
  3. Skin skin = new Skin(Gdx.files.internal("data/uiskin.json"));
  4. label = new Label("", skin);
  5. Table root = new Table(skin);
  6. root.setFillParent(true);
  7. root.setBackground(skin.getDrawable("default-pane"));
  8. root.debug().defaults().space(6);
  9. root.add(new TextButton("Button 1", skin));
  10. root.add(new TextButton("Button 2", skin)).row();
  11. root.add("Press spacebar to change the viewport:").colspan(2).row();
  12. root.add(label).colspan(2);
  13. stage.addActor(root);
  14. viewports = getViewports(stage.getCamera());
  15. names = getViewportNames();
  16. stage.setViewport(viewports.first());
  17. label.setText(names.first());
  18. Gdx.input.setInputProcessor(new InputMultiplexer(new InputAdapter() {
  19. public boolean keyDown (int keycode) {
  20. if (keycode == Input.Keys.SPACE) {
  21. int index = (viewports.indexOf(stage.getViewport(), true) + 1) % viewports.size;
  22. label.setText(names.get(index));
  23. Viewport viewport = viewports.get(index);
  24. stage.setViewport(viewport);
  25. resize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
  26. }
  27. return false;
  28. }
  29. }, stage));
  30. }

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

  1. table.add(musicBox);
  2. table.add(btLoop);
  3. table.setFillParent(true);
  4. stage.addActor(table);

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

  1. table.setFillParent(true);
  2. table.add(scroll).expandX().left().width(100);
  3. stage.addActor(table);

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

  1. root.setFillParent(true);
  2. root.setBackground(skin.getDrawable("default-pane"));
  3. root.defaults().space(6);

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

  1. root.setFillParent(true);
  2. root.add(new Label("meow meow meow meow meow meow meow meow meow meow meow meow", skin)).colspan(3).expandX();
  3. root.add(new TextButton("Text Button", skin));

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

  1. pan.setValue(0);
  2. final Label panValue = new Label("0.0", skin);
  3. table.setFillParent(true);

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

  1. private void populateTable (){
  2. Table root = new Table();
  3. stage.addActor(root);
  4. root.setFillParent(true);
  5. root.pad(5);
  6. root.defaults().left().space(5);

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

  1. container.setFillParent(true);

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

  1. root.setFillParent(true);

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

  1. root.setFillParent(true);
  2. root.debug().defaults().space(6).size(110);
  3. stage.addActor(root);

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

  1. table.setFillParent(true);
  2. table.pad(5);
  3. table.add(fpsLabel).expandX().left().row();

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

  1. table.setFillParent(true);
  2. table.pad(5);
  3. table.add(fpsLabel).expandX().left().row();

相关文章