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

Examples of com.badlogic.gdx.scenes.scene2d.ui.TextButton.addListener()


        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));
                }
            });
View Full Code Here


        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();
View Full Code Here

  }

  public static TextButton newButton( String text, ClickListener listener ) {
    TextButton b = new TextButton( text, UISkin );
    if( listener != null ) {
      b.addListener( listener );
    }
    return b;
  }

  public static void dispose() {
View Full Code Here

        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);
            }
        });
View Full Code Here

                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));
            }
        });
View Full Code Here

                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);
            }
        });
View Full Code Here

        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));
            }
        });
View Full Code Here

                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));
            }
        });
View Full Code Here

                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));

            }
View Full Code Here

                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);
            }
        });
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.