Package com.badlogic.gdx.scenes.scene2d.ui

Examples of com.badlogic.gdx.scenes.scene2d.ui.Table


    Label l = new Label( text, UISkin );
    return l;
  }

  public static Table newTable() {
    Table t = new Table();
    if( DebugUI ) {
      t.debug();
    }
    return t;
  }
View Full Code Here


  @Override
  public void show() {

        stage = new Stage();

        Table table = new Table(game.getSkin());
        table.setFillParent(true);
        table.center();

        Label title = new Label("JFIGHTER2DX", game.getSkin());
        title.setFontScale(2.5f);

        TextButton quickButton = new TextButton("RESUME", game.getSkin());
        quickButton.addListener(new ClickListener() {
            public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
                dispose();
                game.setScreen(gameScreen);
            }
        });
        TextButton historyButton = new TextButton("RETURN TO MAIN MENU", game.getSkin());
        historyButton.addListener(new ClickListener() {
            public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
                dispose();
                game.setScreen(new MainMenuScreen(game));
            }
        });
        TextButton exitButton = new TextButton("QUIT GAME", game.getSkin());
        exitButton.addListener(new ClickListener() {
            public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
                dispose();
                System.exit(0);
            }
        });

        table.row().height(150);
        table.add(title).center().pad(35f);
        table.row().height(70);
        table.add(quickButton).center().width(300).pad(5f);
        table.row().height(70);
        table.add(historyButton).center().width(300).pad(5f);
        table.row().height(70);
        table.add(exitButton).center().width(300).pad(5f);

        stage.addActor(table);
        Gdx.input.setInputProcessor(stage);
  }
View Full Code Here

  @Override
  public void show() {

        stage = new Stage();

        Table table = new Table(game.getSkin());
        table.setFillParent(true);
        table.center();

        Label title = new Label("JFIGHTER2DX\nMAIN MENU", game.getSkin());
        title.setFontScale(2.5f);

        TextButton quickButton = new TextButton("QUICK PLAY", game.getSkin());
        quickButton.addListener(new ClickListener() {
            public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
                dispose();
                game.setScreen(new GameScreen(game, GameType.QUICK));
            }
        });
        TextButton historyButton = new TextButton("PLAY HISTORY", game.getSkin());
        historyButton.addListener(new ClickListener() {
            public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
                dispose();
                game.setScreen(new GameScreen(game, GameType.HISTORY));
            }
        });
        TextButton optionsButton = new TextButton("OPTIONS", game.getSkin());
        optionsButton.addListener(new ClickListener() {
            public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
                dispose();
                game.setScreen(new ConfigurationScreen(game));

            }
        });
        TextButton exitButton = new TextButton("QUIT GAME", game.getSkin());
        exitButton.addListener(new ClickListener() {
            public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
                dispose();
                System.exit(0);
            }
        });

        Label aboutLabel = new Label("jfighter2dx v1\n(c) Santiago Faci\nhttp://bitbucket.org/sfaci/jfighter2dx", game.getSkin());
        aboutLabel.setFontScale(1f);

        table.row().height(150);
        table.add(title).center().pad(35f);
        table.row().height(70);
        table.add(quickButton).center().width(300).pad(5f);
        table.row().height(70);
        table.add(historyButton).center().width(300).pad(5f);
        table.row().height(70);
        table.add(optionsButton).center().width(300).pad(5f);
        table.row().height(70);
        table.add(exitButton).center().width(300).pad(5f);
        table.row().height(70);
        table.add(aboutLabel).center().pad(55f);

        stage.addActor(table);
        Gdx.input.setInputProcessor(stage);
  }
View Full Code Here

    private void loadScreen() {

        stage = new Stage();

        Table table = new Table(game.getSkin());
        table.setFillParent(true);
        table.center();

        final Label title = new Label("JFIGHTER2DX TOP SCORE", game.getSkin());
        title.setFontScale(2.5f);
        // Carga la lista de puntuaciones (top 10)
        String values = loadScores();
        Label labelTopScore = new Label(values, game.getSkin());
        Label labelScore = new Label("YOUR SCORE: " + game.score, game.getSkin());

        table.row().height(50);
        table.add(title).center().pad(35f);
        table.row().height(200);
        table.add(labelTopScore).center().pad(5f);
        table.row().height(20);
        table.add(labelScore).center().pad(5f);

        // El usuario ya ha rellenado su nombre
        if (done) {
            TextButton quitButton = new TextButton("MAIN MENU", game.getSkin());
            quitButton.addListener(new ClickListener() {
                public void touchUp(InputEvent event, float x, float y, int pointer, int button) {

                    game.setScreen(new MainMenuScreen(game));
                }
            });

            table.row().height(70);
            table.add(quitButton).center().width(300).pad(5f);
        }
        else {
            // El usuario aún no he escrito su nombre
            final TextField nameTextField = new TextField("TYPE YOUR NAME", game.getSkin());

            TextButton quitButton = new TextButton("OK", game.getSkin());
            quitButton.addListener(new ClickListener() {
                public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
                    ConfigurationManager.addScores(nameTextField.getText(), game.score);
                    stage.clear();
                    done = true;
                    loadScreen();
                }
            });

            table.row().height(20);
            table.add(nameTextField).center().width(250).pad(55f);
            table.row().height(50);
            table.add(quitButton).center().width(300).pad(5f);
        }

        stage.addActor(table);
        Gdx.input.setInputProcessor(stage);
  }
View Full Code Here

     */
  private void loadScreen() {

        stage = new Stage();

        Table table = new Table(game.getSkin());
        table.setFillParent(true);
        table.center();

        Label title = new Label("JFIGHTER2DX\nSETTINGS", game.getSkin());
        title.setFontScale(2.5f);

        final CheckBox checkSound = new CheckBox(" SOUND", game.getSkin());
        checkSound.setChecked(prefs.getBoolean("sound"));
        checkSound.addListener(new ClickListener() {
            public void touchUp(InputEvent event, float x, float y, int pointer, int button) {

                prefs.putBoolean("sound", checkSound.isChecked());
            }
        });

        Label difficultyLabel = new Label("-- DIFFICULTY --", game.getSkin());

        String[] resolutionsArray = {"LOW", "MEDIUM", "HIGH"};
        final List difficultyList = new List(resolutionsArray, game.getSkin());

        difficultyList.addListener(new ClickListener() {
            public void touchUp(InputEvent event, float x, float y, int pointer, int button) {

                switch (difficultyList.getSelectedIndex()) {
                    case 0:
                        prefs.putString("difficulty", "low");
                        break;
                    case 1:
                        prefs.putString("difficulty", "medium");
                        break;
                    case 2:
                        prefs.putString("difficulty", "high");
                        break;
                    default:
                }
            }
        });

        TextButton exitButton = new TextButton("MAIN MENU", game.getSkin());
        exitButton.addListener(new ClickListener() {
            public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
                prefs.flush();
                dispose();
                game.setScreen(new MainMenuScreen(game));
            }
        });

        Label aboutLabel = new Label("jfighter2dx v1\n(c) Santiago Faci\nhttp://bitbucket.org/sfaci/jfighter2dx", game.getSkin());
        aboutLabel.setFontScale(1f);

        table.row().height(150);
        table.add(title).center().pad(35f);
        table.row().height(20);
        table.add(checkSound).center().pad(5f);
        table.row().height(20);
        table.add(difficultyLabel).center().pad(5f);
        table.row().height(70);
        table.add(difficultyList).center().pad(5f);
        table.row().height(70);
        table.add(exitButton).center().width(300).pad(5f);
        table.row().height(70);
        table.add(aboutLabel).center().pad(55f);

        stage.addActor(table);
        Gdx.input.setInputProcessor(stage);
  }
View Full Code Here

    @Override
    public void show() {

        stage = new Stage();

        Table table = new Table(game.getSkin());
        table.setFillParent(true);
        table.center();

        Label title = new Label("JUMPER2DX", game.getSkin());
        title.setFontScale(2.5f);

        TextButton quickButton = new TextButton("RESUME", game.getSkin());
        quickButton.addListener(new ClickListener() {
            public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
                dispose();
                game.setScreen(gameScreen);
            }
        });
        TextButton historyButton = new TextButton("RETURN TO MAIN MENU", game.getSkin());
        historyButton.addListener(new ClickListener() {
            public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
                dispose();
                gameScreen.dispose();
                game.setScreen(new MainMenuScreen(game));
            }
        });
        TextButton exitButton = new TextButton("QUIT GAME", game.getSkin());
        exitButton.addListener(new ClickListener() {
            public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
                dispose();
                System.exit(0);
            }
        });

        table.row().height(150);
        table.add(title).center().pad(35f);
        table.row().height(70);
        table.add(quickButton).center().width(300).pad(5f);
        table.row().height(70);
        table.add(historyButton).center().width(300).pad(5f);
        table.row().height(70);
        table.add(exitButton).center().width(300).pad(5f);

        stage.addActor(table);
        Gdx.input.setInputProcessor(stage);
    }
View Full Code Here

    @Override
    public void show() {

        stage = new Stage();

        Table table = new Table(game.getSkin());
        table.setFillParent(true);
        table.center();

        Label title = new Label("JUMPER2DX\nMAIN MENU", game.getSkin());
        title.setFontScale(2.5f);

        TextButton playButton = new TextButton("PLAY GAME", game.getSkin());
        playButton.addListener(new ClickListener() {
            public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
                //dispose();
                game.setScreen(new GameScreen(game));
            }
        });
        TextButton optionsButton = new TextButton("OPTIONS", game.getSkin());
        optionsButton.addListener(new ClickListener() {
            public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
                dispose();
                // FIXME ¿Menú de opciones?

            }
        });
        TextButton exitButton = new TextButton("QUIT GAME", game.getSkin());
        exitButton.addListener(new ClickListener() {
            public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
                dispose();
                System.exit(0);
            }
        });

        Label aboutLabel = new Label("jumper2dx v0.2\n(c) Santiago Faci\nhttp://bitbucket.org/sfaci/jumper2dx", game.getSkin());
        aboutLabel.setFontScale(1f);

        table.row().height(200);
        table.add(title).center().pad(35f);
        table.row().height(75);
        table.add(playButton).center().width(500).pad(5f);
        table.row().height(75);
        table.add(optionsButton).center().width(500).pad(5f);
        table.row().height(75);
        table.add(exitButton).center().width(500).pad(5f);
        table.row().height(75);
        table.add(aboutLabel).center().pad(55f);

        stage.addActor(table);
        Gdx.input.setInputProcessor(stage);
    }
View Full Code Here

    }

    @Override
    public void show() {

        Table table = new Table();
        table.setFillParent(true);
        table.center();

        // Muestra la imagen de SplashScreen como una animación
        splashImage.addAction(Actions.sequence(Actions.alpha(0), Actions.fadeIn(1f),
                Actions.delay(1.5f), Actions.run(new Runnable() {
                    @Override
                    public void run() {
                        splashDone = true;
                    }
                })
        ));

        table.row().height(splashTexture.getHeight());
        table.add(splashImage).center();
        stage.addActor(table);

        // Lanza la carga de recursos
        ResourceManager.loadAllResources();
    }
View Full Code Here

        public void clicked (InputEvent event, float x, float y) {
          isUpdate = !isUpdate;
          playPauseButton.setText(isUpdate ? "Pause" : "Play");
        }
      });
      Table table = new Table(skin);
      table.setFillParent(true);
      table.pad(5);
      table.add(fpsLabel).expandX().left().row();
      table.add(pointCountLabel).expandX().left().row();
      table.add(billboardCountLabel).expandX().left().row();
      table.add(modelInstanceCountLabel).expandX().left().row();
      table.add(maxLabel).expandX().left().row();
      table.add(playPauseButton).expand().bottom().left().row();
      ui.addActor(table);
     
      setTexture((Texture)assetManager.get(DEFAULT_BILLBOARD_PARTICLE));
      effectPanel.createDefaultEmitter(ControllerType.Billboard, true, true);
    }
View Full Code Here

    }

    @Override
    public void show() {

        Table table = new Table();
        table.setFillParent(true);
        table.center();

        // Muestra la imagen de SplashScreen como una animación
        splashImage.addAction(Actions.sequence(Actions.alpha(0), Actions.fadeIn(1f),
            Actions.delay(1.5f), Actions.run(new Runnable() {
            @Override
            public void run() {
                splashDone = true;
            }
        })));

        table.row().height(splashTexture.getHeight());
        table.add(splashImage).center();
        stage.addActor(table);

        // Lanza la carga de recursos
        ResourceManager.loadAllResources();
    }
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.scenes.scene2d.ui.Table

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.