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

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


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


    return t;
  }

  private Table buildPanelActionButtons( final Table topPanel, final float yWhenShown, final float yWhenHidden ) {
    TextButton btnShowHide = ResourceFactory.newButton( "Show/hide panel", new ClickListener() {
      @Override
      public void clicked( InputEvent event, float x, float y ) {
        if( !panelShown ) {
          topPanel.addAction( Actions.moveTo( topPanel.getX(), yWhenShown, 0.5f, Interpolation.exp10 ) );
          topPanel.addAction( Actions.alpha( 1f, 0.5f, Interpolation.exp10 ) );
View Full Code Here

  public static TextButton newButton( String text ) {
    return newButton( text, null );
  }

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

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

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

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

    style.up = skin.getDrawable("buttonnormal");
    style.down = skin.getDrawable("buttonpressed");

    style.font = bonzai;
    style.fontColor= Color.BLACK;
    button = new TextButton("Press Me", style);
    button.setWidth(400);
    button.setHeight(100);
    button.setX(Gdx.graphics.getWidth() / 2 - button.getWidth() / 2);
    button.setY(Gdx.graphics.getHeight() / 2 - button.getHeight() / 2);
View Full Code Here

    BitmapFont font = Configuration.bonzai24;

    style.font = font;

    TextButton no = new TextButton("No", style);
    no.setWidth(4 * Configuration.gameScale);
    no.setHeight(2 * Configuration.gameScale);
    no.setScale(Configuration.gameScale / 20);

    no.setPosition((playArea.x + (playArea.width / 2)), (playArea.y + playArea.height * .45f));

    no.addListener(new InputListener() {
      public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
        System.out.println("down");
        return true;
      }

View Full Code Here

    BitmapFont font = Configuration.bonzai24;

    style.font = font;

    TextButton yes = new TextButton("Yes", style);
    yes.setWidth(4 * Configuration.gameScale);
    yes.setHeight(2 * Configuration.gameScale);

    yes.setPosition((playArea.x + (playArea.width / 2) - (4 * Configuration.gameScale)),
        (playArea.y + playArea.height * .45f));
    yes.setScale(Configuration.gameScale / 20);
    yes.addListener(new InputListener() {
      public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
        System.out.println("down");
        return true;
      }

View Full Code Here

    TextButtonStyle style = new TextButtonStyle();
    style.up = skin.getDrawable("buttonnormal");
    style.down = skin.getDrawable("buttonpressed");
    style.font = black;

    button = new TextButton("Play!", style);
    button.setWidth(400);
    button.setHeight(100);
    button.setX(Gdx.graphics.getWidth() / 2 - button.getWidth() / 2);
    button.setY(Gdx.graphics.getHeight() / 2 - button.getHeight() / 2);
View Full Code Here

TOP

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

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.