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

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


    sb.setItems( items );
    return sb;
  }

  public static Label newLabel( String text ) {
    Label l = new Label( text, UISkin );
    return l;
  }
View Full Code Here


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

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

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

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

    public void create() {
        setScreen(new Screen() {

            private final Stage stage = new Stage(new StretchViewport(GAME_VIEWPORT_WIDTH, GAME_VIEWPORT_HEIGHT));
            private final BitmapFont bitmapFont = new BitmapFont();
            private final Label fps = new Label("", new Label.LabelStyle(bitmapFont, Color.WHITE));
            private final Road road = new Road();

            @Override
            public void render(float v) {
                GL20 gl = Gdx.graphics.getGL20();
                gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
                fps.setText("" + Gdx.graphics.getFramesPerSecond());

                road.update(v);
                road.render(stage.getCamera());

                stage.act();
                stage.draw();
            }

            @Override
            public void resize(int i, int i2) {

            }

            @Override
            public void show() {
                fps.setFontScale(5F);
                stage.addActor(fps);
                road.resetRoad();
            }

            @Override
View Full Code Here

    text = "Continue?";
    font = new BitmapFont(Gdx.files.internal("data/fonts/bonzai24.fnt"),
        Gdx.files.internal("data/fonts/bonzai24.png"), false);
   
    LabelStyle ls = new LabelStyle(Configuration.bonzai24,Color.WHITE);
    label = new Label(text, ls);
    label.setAlignment(Align.center);
  }
View Full Code Here

    super();
    text = "Victory";
    font = Configuration.bonzai32;
   
    LabelStyle ls = new LabelStyle(font,Color.WHITE);
    label = new Label(text, ls);
    label.setAlignment(Align.center);
  }
View Full Code Here

    this.text = message.toString();
    this.font = font;
    this.id=id;
   
    LabelStyle ls = new LabelStyle(this.font,Color.WHITE);
    label = new Label(text, ls);
    label.setFontScale(1*Configuration.gameScale/20);
    label.setAlignment(Align.center);
  }
 
View Full Code Here

    super();
    text = "Paused";
    font = Configuration.bonzai32;
   
    LabelStyle ls = new LabelStyle(font,Color.WHITE);
    label = new Label(text, ls);
    label.setAlignment(Align.center);
  }
View Full Code Here

TOP

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

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.