Пример #1
0
  @Override
  public void render() {
    /// Clear everything first
    Gdx.gl.glClearColor(1, 1, 1, 1);
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

    gsm = super.gsm;
    Stage stage = new Stage();

    /// Create Skin
    createSkin();

    /// Create Title
    CharSequence charSeq;
    charSeq = "MANIC";
    Label title = new Label(charSeq, skin);
    title.setPosition(
        (float) (Gdx.graphics.getWidth() * .49 - Gdx.graphics.getWidth() * .125),
        (float) (Gdx.graphics.getHeight() * .70));
    title.setFontScale(4);

    /// Create Start Button
    TextButton startButton = new TextButton("Press Space to Start", skin);
    startButton.setPosition(
        Gdx.graphics.getWidth() / 2 - Gdx.graphics.getWidth() / 8, Gdx.graphics.getHeight() / 3);

    /// Add and draw
    stage.addActor(title);
    stage.addActor(startButton);
    stage.act();
    stage.draw();
  }
Пример #2
0
  public UIHelper() {
    stage = new Stage();
    uiSkin = new Skin(Gdx.files.internal("data/uiskin.json"));

    loadTouchpad();

    final TextButton button = new TextButton("place team", uiSkin, "default");

    float width = Gdx.graphics.getWidth();
    float height = Gdx.graphics.getHeight();

    button.setWidth(100);
    button.setHeight(50);
    button.setPosition(width - 120, 20);

    button.addListener(
        new ClickListener() {
          @Override
          public void clicked(InputEvent event, float x, float y) {
            placeTeam = !placeTeam;
            if (placeTeam) button.setText("ACTIVE");
            else button.setText("place team");
          }
        });

    final TextButton button2 = new TextButton("place enemy", uiSkin, "default");

    button2.setWidth(100);
    button2.setHeight(50);
    button2.setPosition(width - 240, 20);

    button2.addListener(
        new ClickListener() {
          @Override
          public void clicked(InputEvent event, float x, float y) {
            placeEnemy = !placeEnemy;
            if (placeEnemy) button2.setText("ACTIVE");
            else button2.setText("place enemy");
          }
        });

    stage.addActor(button);
    stage.addActor(button2);
  }
Пример #3
0
  private void loadHUD() {
    Skin skin = new Skin();
    TextButtonStyle style = new TextButton.TextButtonStyle();
    skin.add("default", new BitmapFont());
    style.font = skin.getFont("default");
    skin.add("default", style);

    TextButton button1 = new TextButton("HUD-Label1", skin);
    uiStage.addActor(button1);
    button1.setPosition(camera.viewportWidth / 2 - 100, 0);
    button1.setBounds(button1.getX(), button1.getY(), button1.getWidth(), button1.getHeight());

    uiStage.addActor(new TextButton("HUD-Label2", skin));
  }
Пример #4
0
  public StartScreen(SpaceSim game) {
    this.game = game;
    background = new Texture(Gdx.files.internal("bg5.jpg"));
    batch = new SpriteBatch();
    stage = new Stage();
    heading = "Space Simulator";

    Gdx.input.setInputProcessor(stage);

    FreeTypeFontGenerator generator =
        new FreeTypeFontGenerator(Gdx.files.internal("fonts/Philosopher-Regular.ttf"));
    FreeTypeFontParameter parameter = new FreeTypeFontParameter();
    buttonFont = generator.generateFont(parameter);
    buttonFont.setColor(1, 1, 1, 1);
    parameter.size = 72;
    headingFont = generator.generateFont(parameter);
    headingFont.setColor(1, 1, 1, 1);
    generator.dispose();

    GlyphLayout layout = new GlyphLayout(headingFont, heading);
    headingX = (int) ((Gdx.graphics.getWidth() / 2) - (layout.width / 2));
    headingY = 550;

    this.skin = new Skin();
    this.skin.add("default", buttonFont);

    Pixmap pixmap = new Pixmap(200, 50, Pixmap.Format.RGB888);
    pixmap.setColor(Color.WHITE);
    pixmap.fill();
    this.skin.add("background", new Texture(pixmap));

    TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
    textButtonStyle.up = this.skin.newDrawable("background", Color.GRAY);
    textButtonStyle.over = this.skin.newDrawable("background", Color.LIGHT_GRAY);
    textButtonStyle.font = this.skin.getFont("default");
    this.skin.add("default", textButtonStyle);

    TextButton startButton = new TextButton("Start", this.skin);
    startButton.addListener(
        new ClickListener() {
          @Override
          public void clicked(InputEvent event, float x, float y) {
            StartScreen.this.game.setScreen(new GalaxyMapScreen(StartScreen.this.game));
          };
        });
    startButton.setPosition((Gdx.graphics.getWidth() / 2) - (startButton.getWidth() / 2), 300);

    this.stage.addActor(startButton);
  }
Пример #5
0
  public void showMenu() {
    continua = new TextButton("CONTINUA", Assets.getInstance().getButtonStyle());
    continua.setPosition(100, 400);
    toMenu = new TextButton("MENIU", Assets.getInstance().getButtonStyle());
    group = new Group();
    group.setSize(100, 100);
    group.addActor(continua);
    group.addActor(toMenu);
    group.setPosition(100, 400);

    Table table = new Table();
    table.add(continua);
    table.setPosition(100, 400);
    // stage.addActor(table);

    // stage.addActor(continua);
  }
  public MathsScreen(Game g) {
    game = g;
    stage = new Stage();
    Gdx.input.setInputProcessor(stage); // get input from our stage

    num1 = MathUtils.random(10, 100); // libgdx easy random numbers :)
    num2 = MathUtils.random(10, 100);
    ans = num1 * num2;

    Skin skin =
        new Skin(
            Gdx.files.internal(
                "uiskin.json")); // set what the UI elements are going to look like, libgdx provides
    // file abstraction to make it easy to access files on any platform

    question =
        new Label(
            "What is the area of a rectangle of   " + num1 + "    by    " + num2,
            skin); // Create a label element
    question.setPosition(100, 500); // Position it
    stage.addActor(question); // Add the lable to the stage

    answer = new TextField("", skin); // Create a textfield element
    answer.setPosition(300, 340); // Position it
    stage.addActor(answer); // Add it to the stage

    feedback = new Label("", skin); // Create a label element
    feedback.setPosition(300, 150); // Position it
    stage.addActor(feedback); // Add the lable to the stage

    check = new TextButton("Check your answer", skin);
    check.setPosition(300, 200);
    check.addListener(
        new ClickListener() // add the listener as an anonymous? method, inline method
        {
          // autocomplete the code below by typing clicked and then ctrl + space, modify to add our
          // own btClicked method
          public void clicked(InputEvent e, float x, float y) {
            btnClicked();
          }
        });
    stage.addActor(check);
  }
Пример #7
0
  public WinnerScreen(ArrayList<Integer> playerPositions, Game game, Client client, Server server) {
    super(game, client, server);

    // Set input and viewpoint
    stage = new Stage(new StretchViewport(Constants.SCREENWIDTH, Constants.SCREENHEIGHT));
    Gdx.input.setInputProcessor(stage);

    // Unhides the cursor
    Gdx.input.setCursorCatched(false);

    this.playerPositions = playerPositions;

    // Set background
    rootTable.background(
        new TextureRegionDrawable(new TextureRegion(TextureManager.hostBackground)));
    rootTable.setFillParent(true);
    stage.addActor(rootTable);

    // Initialise Font
    FreeTypeFontGenerator.FreeTypeFontParameter fontOptions =
        new FreeTypeFontGenerator.FreeTypeFontParameter();
    fontOptions.size = 11;
    BitmapFont font = TextureManager.menuFont.generateFont(fontOptions);

    /** ------------------------LABEL STYLE------------------------* */
    Label.LabelStyle labelStyle = new Label.LabelStyle();
    fontOptions.size = 60;
    labelStyle.font = TextureManager.menuFont.generateFont(fontOptions);
    labelStyle.fontColor = Color.GOLD;

    /** ------------------------PLAYER DISPLAY WIDGET------------------------* */
    // Table options
    Table table = new Table();
    table.setFillParent(true);

    // P1 spawn field
    p1Field = new Container();
    p1Field.background(new TextureRegionDrawable(TextureManager.p1WalkingDownAnim.getKeyFrame(0)));
    table.add(p1Field).width(64).height(64);

    // P2 spawn field
    p2Field = new Container();
    p2Field.setVisible(false);
    p2Field.background(new TextureRegionDrawable(TextureManager.p2WalkingDownAnim.getKeyFrame(0)));
    table.add(p2Field).width(64).height(64).padLeft(96);

    // P3 spawn field
    p3Field = new Container();
    p3Field.setVisible(false);
    p3Field.background(new TextureRegionDrawable(TextureManager.p3WalkingDownAnim.getKeyFrame(0)));
    table.add(p3Field).width(64).height(64).padLeft(96);

    // P4 spawn field
    p4Field = new Container();
    p4Field.setVisible(false);
    p4Field.background(new TextureRegionDrawable(TextureManager.p4WalkingDownAnim.getKeyFrame(0)));
    table.add(p4Field).width(64).height(64).padLeft(96);

    // Stage & group options
    joinedPlayerGroup.addActor(table);
    joinedPlayerGroup.setPosition(443, 150);
    stage.addActor(joinedPlayerGroup);

    /** ------------------------PLAYER HIGHLIGHT WIDGET------------------------* */
    // Table options
    Table table2 = new Table();
    table2.setFillParent(true);

    // P1 spawn field
    p1FieldHighlight = new Container();
    p1FieldHighlight.setVisible(false);
    p1FieldHighlight.background(
        new TextureRegionDrawable(new TextureRegion(TextureManager.playerMarker)));
    table2.add(p1FieldHighlight).width(80).height(77);

    // P2 spawn field
    p2FieldHighlight = new Container();
    p2FieldHighlight.setVisible(false);
    p2FieldHighlight.background(
        new TextureRegionDrawable(new TextureRegion(TextureManager.playerMarker)));
    table2.add(p2FieldHighlight).width(80).height(77).padLeft(80);

    // P3 spawn field
    p3FieldHighlight = new Container();
    p3FieldHighlight.setVisible(false);
    p3FieldHighlight.background(
        new TextureRegionDrawable(new TextureRegion(TextureManager.playerMarker)));
    table2.add(p3FieldHighlight).width(80).height(77).padLeft(80);

    // P4 spawn field
    p4FieldHighlight = new Container();
    p4FieldHighlight.setVisible(false);
    p4FieldHighlight.background(
        new TextureRegionDrawable(new TextureRegion(TextureManager.playerMarker)));
    table2.add(p4FieldHighlight).width(80).height(77).padLeft(80);

    // Stage & group options
    playerhighlightWidget.addActor(table2);
    playerhighlightWidget.setPosition(442, 152);
    stage.addActor(playerhighlightWidget);

    /** ------------------------LABELS------------------------* */

    // Titel
    titel = new Label("", labelStyle);
    titel.setAlignment(Align.center);
    titel.setPosition((Constants.SCREENWIDTH - titel.getWidth()) / 2 + 50, 385);
    stage.addActor(titel);

    // If you are the winner
    if (Constants.PLAYERID == playerPositions.get(playerPositions.size() - 1)) {
      titel.setText("YOU WON!");
      isWinner = true;
    } else {
      isWinner = false;
      titel.setText("YOU LOOSE!");
      titel.setColor(Color.RED);
    }

    if (-1 == playerPositions.get(playerPositions.size() - 1)) {
      titel.setText("DRAW!");
      titel.setColor(Color.DARK_GRAY);
      isWinner = false;
    }

    Table positionTable = new Table();
    positionTable.setFillParent(true);

    p1Position = new Label("", labelStyle);
    p1Position.setAlignment(Align.center);

    p2Position = new Label("", labelStyle);
    p2Position.setAlignment(Align.center);

    p3Position = new Label("", labelStyle);
    p3Position.setAlignment(Align.center);

    p4Position = new Label("", labelStyle);
    p4Position.setAlignment(Align.center);

    positionTable.add(p1Position).width(64).height(64);
    positionTable.add(p2Position).width(64).height(64).padLeft(96);
    positionTable.add(p3Position).width(64).height(64).padLeft(96);
    positionTable.add(p4Position).width(64).height(64).padLeft(96);

    positionPlayerWidget.addActor(positionTable);
    positionPlayerWidget.setPosition(443, 230);
    stage.addActor(positionPlayerWidget);

    /** ------------------------MUSIC------------------------* */
    if (isWinner == false) {
      AudioManager.setCurrentMusic(AudioManager.getLooserMusic());
      AudioManager.getCurrentMusic().setLooping(true);
      AudioManager.getCurrentMusic().play();
      AudioManager.getCurrentMusic().setVolume(AudioManager.getMusicVolume() * 4);
    } else {
      AudioManager.setCurrentMusic(AudioManager.getWinnerMusic());
      AudioManager.getCurrentMusic().setLooping(true);
      AudioManager.getCurrentMusic().play();
      AudioManager.getCurrentMusic().setVolume(AudioManager.getMusicVolume() * 6);
    }

    /** ------------------------BUTTONS------------------------* */
    TextButton.TextButtonStyle textButtonStyleBack = new TextButton.TextButtonStyle();
    textButtonStyleBack.font = font;
    textButtonStyleBack.up = backSkin.getDrawable("button_up");
    textButtonStyleBack.down = backSkin.getDrawable("button_down");
    textButtonStyleBack.over = backSkin.getDrawable("button_checked");

    // Back button
    backButton = new TextButton("", textButtonStyleBack);
    backButton.setPosition(0, Constants.SCREENHEIGHT - backButton.getHeight() + 7);
    stage.addActor(backButton);

    renderPlayers();

    // Add click listener --> Back button
    backButton.addListener(
        new ChangeListener() {
          @Override
          public void changed(ChangeListener.ChangeEvent event, Actor actor) {
            // Add click musik
            AudioManager.playClickSound();

            // Wait till sound is done
            try {
              Thread.sleep(100);

            } catch (InterruptedException ex) {

            }

            if (isWinner) {
              AudioManager.getCurrentMusic().stop();
            } else {
              AudioManager.getCurrentMusic().stop();
            }

            server.stopServer();
            game.setScreen(new MenuScreen(game, client, server));
          }
        });
  }
Пример #8
0
  private void loadScreen() {

    // Grafo de escena que contendrá todo el menú
    stage = new Stage();

    // Crea una tabla, donde añadiremos los elementos de menú
    Table table = new Table();
    table.setPosition(Constants.SCREEN_WIDTH / 2.5f, Constants.SCREEN_HEIGHT / 1.5f);
    // La tabla ocupa toda la pantalla
    table.setFillParent(true);
    table.setHeight(500);
    stage.addActor(table);

    // Etiqueta de texto
    Label label = new Label("Bienvenido a JFighter2DX", game.getSkin());
    table.addActor(label);

    // Botón
    TextButton buttonPlay = new TextButton("Partida Rapida", game.getSkin());
    buttonPlay.setPosition(label.getOriginX(), label.getOriginY() - 120);
    buttonPlay.setWidth(200);
    buttonPlay.setHeight(40);
    buttonPlay.addListener(
        new InputListener() {
          public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
            return true;
          }

          public void touchUp(InputEvent event, float x, float y, int pointer, int button) {

            dispose();
            game.setScreen(new GameScreen(game, GameType.QUICK));
          }
        });
    table.addActor(buttonPlay);

    // Botón
    TextButton buttonHistory = new TextButton("Modo Historia", game.getSkin());
    buttonHistory.setPosition(label.getOriginX(), label.getOriginY() - 170);
    buttonHistory.setWidth(200);
    buttonHistory.setHeight(40);
    buttonHistory.addListener(
        new InputListener() {
          public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
            return true;
          }

          public void touchUp(InputEvent event, float x, float y, int pointer, int button) {

            dispose();
            game.setScreen(new GameScreen(game, GameType.HISTORY));
          }
        });
    table.addActor(buttonHistory);

    // Botón
    TextButton buttonConfig = new TextButton("Configurar", game.getSkin());
    buttonConfig.setPosition(label.getOriginX(), label.getOriginY() - 220);
    buttonConfig.setWidth(200);
    buttonConfig.setHeight(40);
    buttonConfig.addListener(
        new InputListener() {
          public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
            return true;
          }

          public void touchUp(InputEvent event, float x, float y, int pointer, int button) {

            dispose();
            game.setScreen(new ConfigurationScreen(game));
          }
        });
    table.addActor(buttonConfig);

    // Botón
    TextButton buttonQuit = new TextButton("Salir", game.getSkin());
    buttonQuit.setPosition(label.getOriginX(), label.getOriginY() - 270);
    buttonQuit.setWidth(200);
    buttonQuit.setHeight(40);
    buttonQuit.addListener(
        new InputListener() {
          public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
            return true;
          }

          public void touchUp(InputEvent event, float x, float y, int pointer, int button) {

            game.dispose();
            System.exit(0);
          }
        });
    table.addActor(buttonQuit);

    Gdx.input.setInputProcessor(stage);
  }
Пример #9
0
  @Override
  public void show() {
    // TODO Auto-generated method stub
    stage = new Stage();
    font = new BitmapFont(Gdx.files.internal("font.fnt"), false);
    style = new LabelStyle(font, Color.RED);
    label = new Label("Juego de Prueba", style);
    label.setPosition(Gdx.graphics.getWidth() / 3, Gdx.graphics.getHeight() - 100);
    stage.addActor(label);

    skin = new Skin();
    buttonatlas = new TextureAtlas("buttons/button.pack");
    skin.addRegions(buttonatlas);

    buttonstyle = new TextButtonStyle();
    buttonstyle.up = skin.getDrawable("button");
    buttonstyle.over = skin.getDrawable("buttonpress");
    buttonstyle.down = skin.getDrawable("buttonpress");
    buttonstyle.font = font;

    button = new TextButton("Play", buttonstyle);

    stage.addActor(button);

    button.addListener(
        new InputListener() {

          @Override
          public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
            // TODO Auto-generated method stub

            game.setScreen(new PlayScreen(game));
            MainMenu.this.dispose();
            return true;
          }
        });

    // ok

    skin2 = new Skin();
    buttonatlas2 = new TextureAtlas("buttons/button2.pack");
    skin2.addRegions(buttonatlas2);

    buttonstyle2 = new TextButtonStyle();
    buttonstyle2.up = skin2.getDrawable("button2");
    buttonstyle2.over = skin2.getDrawable("button2press");
    buttonstyle2.down = skin2.getDrawable("button2press");
    buttonstyle2.font = font;

    button2 = new TextButton("", buttonstyle2);

    button2.setPosition(Gdx.graphics.getWidth() - 250, 0);

    stage.addActor(button2);

    button2.addListener(
        new InputListener() {

          @Override
          public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
            // TODO Auto-generated method stub

            game.setScreen(new tablescreen(game));
            MainMenu.this.dispose();
            return true;
          }
        });

    batch = new SpriteBatch();

    Gdx.input.setInputProcessor(stage);
  }
Пример #10
0
  @Override
  public void show() {
    // Creates an stage that contains all the GUI elements
    stage = new Stage();
    stage.clear();
    Gdx.input.setInputProcessor(stage);

    // Title label
    font100orange = new BitmapFont(Gdx.files.internal("fonts/prehistorik100orange.fnt"));
    titleLabel = new Label(this.title, new LabelStyle(font100orange, Color.WHITE));
    titleLabel.setPosition(
        Gdx.graphics.getWidth() / 2.0f - titleLabel.getWidth() / 2,
        7.1f * Gdx.graphics.getHeight() / 9.0f);

    // Textbox label
    white30boldFont = new BitmapFont(Gdx.files.internal("fonts/white30bold.fnt"));
    label1 = new Label("IP adress of game creator:", new LabelStyle(white30boldFont, Color.WHITE));
    label1.setPosition(
        Gdx.graphics.getWidth() / 2.0f - label1.getWidth() / 2,
        6 * Gdx.graphics.getHeight() / 9.0f);

    // Username
    Label usernameLabel = ScreenUtils.createLabel("Username:"******"", 0, 0);
    usernameInput.setPosition(
        Gdx.graphics.getWidth() / 2f - usernameInput.getWidth() / 2f,
        3 * Gdx.graphics.getHeight() / 9.0f);

    // Atlas of the GUI
    atlas = new TextureAtlas("gui/gui.pack");
    skin = new Skin(atlas);

    // Buttons
    font60 = new BitmapFont(Gdx.files.internal("fonts/prehistorik60black.fnt"), false);
    TextButtonStyle buttonStyle = new TextButtonStyle();
    buttonStyle.up = skin.getDrawable("button1");
    buttonStyle.over = skin.getDrawable("button1-over");
    buttonStyle.down = skin.getDrawable("button1-down");
    buttonStyle.font = font60;

    joinButton = new TextButton("Join Game", buttonStyle);
    joinButton.setHeight(100f);
    joinButton.setWidth(500f);
    joinButton.setPosition(
        Gdx.graphics.getWidth() / 2.0f - joinButton.getWidth() / 2,
        1.5f * Gdx.graphics.getHeight() / 9.0f);

    menuButton = new TextButton("Main Menu", buttonStyle);
    menuButton.setHeight(100f);
    menuButton.setWidth(500f);
    menuButton.setPosition(
        Gdx.graphics.getWidth() / 2.0f - joinButton.getWidth() / 2,
        0f * Gdx.graphics.getHeight() / 9.0f);

    // TextField
    white36nonoFont = new BitmapFont(Gdx.files.internal("fonts/white36mono.fnt"));
    TextFieldStyle tfs = new TextFieldStyle();
    tfs.font = white36nonoFont;
    tfs.cursor = skin.getDrawable("cursor");
    tfs.background = skin.getDrawable("textField");
    tfs.fontColor = Color.WHITE;
    inputAddress = new TextField("localhost", tfs);
    inputAddress.setHeight(50);
    inputAddress.setWidth(300);
    inputAddress.setPosition(
        Gdx.graphics.getWidth() / 2.0f - inputAddress.getWidth() / 2,
        5 * Gdx.graphics.getHeight() / 9.0f);

    // add actors
    stage.addActor(joinButton);
    stage.addActor(menuButton);
    stage.addActor(inputAddress);
    stage.addActor(titleLabel);
    stage.addActor(usernameLabel);
    stage.addActor(usernameInput);
    stage.addActor(titleLabel);
    stage.addActor(label1);

    joinButton.addListener(
        new ChangeListener() {

          @Override
          public void changed(ChangeEvent event, Actor actor) {
            System.out.println(inputAddress.getText());

            GameScreen.createInstance(game, false, inputAddress.getText(), usernameInput.getText());
            game.setScreen(GameScreen.getInstance());
            //						game.initInputListeners();

          }
        });

    menuButton.addListener(
        new ChangeListener() {

          @Override
          public void changed(ChangeEvent event, Actor actor) {
            game.setScreen(new MenuScreen(game));
          }
        });
  }
Пример #11
0
  @Override
  public void show() {
    openingtheme.play();
    openingtheme.setLooping(true);
    // openingtheme.setVolume(game.state.volume);
    batch = new SpriteBatch();

    stage = new Stage();
    Gdx.input.setInputProcessor(stage);
    // Straight up stolen from https://www.pinterest.comore
    //        img = new Texture("menubackground1.png");
    img = new Texture("menu_background_fix.png");
    titleimg = new Texture("SlashHeroesTitle.png");
    img.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
    // change these numbers around so it looks good on the presentation phone
    TextureRegion region = new TextureRegion(img, 0, 0, 600, 400);
    sprite = new Sprite(region);
    sprite.setSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    sprite.setOrigin(0, 0);

    skin = new Skin();
    // Generate a 1x1 white texture and store it in the skin named "white".
    Pixmap pixmap = new Pixmap(320, 75, Pixmap.Format.RGBA8888);
    pixmap.setColor(Color.GREEN);
    pixmap.fill();
    skin.add("white", new Texture(pixmap));

    // create the custom font
    FreeTypeFontGenerator generator =
        new FreeTypeFontGenerator(Gdx.files.internal("fonts/slkscre.ttf"));
    FreeTypeFontGenerator.FreeTypeFontParameter parameter =
        new FreeTypeFontGenerator.FreeTypeFontParameter();
    parameter.size = 80;
    BitmapFont OurFont = generator.generateFont(parameter);
    generator.dispose(); // don't forget to dispose to avoid memory leaks!

    // add ourfont to the skin for our buttons.
    skin.add("default", OurFont);

    // textbuttonstyle wont overwrite the font
    TextButtonStyle textButtonStyle = new TextButtonStyle();
    textButtonStyle.up = skin.newDrawable("white", Color.DARK_GRAY);
    textButtonStyle.down = skin.newDrawable("white", Color.DARK_GRAY);
    textButtonStyle.checked = skin.newDrawable("white", Color.BLUE);
    textButtonStyle.over = skin.newDrawable("white", Color.LIGHT_GRAY);
    textButtonStyle.font = skin.getFont("default");

    skin.add("default", textButtonStyle);

    // Create a button with the "default" TextButtonStyle.
    final TextButton PlayButton = new TextButton("PLAY", textButtonStyle);
    // final TextButton ContinueButton = new TextButton("Continue",textButtonStyle);
    final TextButton SettingsButton = new TextButton("Mute", textButtonStyle);
    final TextButton QuitButton = new TextButton("Quit", textButtonStyle);
    PlayButton.setPosition(Gdx.graphics.getWidth() / 2 - 160, Gdx.graphics.getHeight() / 2 - 150);
    // ContinueButton.setPosition(Gdx.graphics.getWidth()/2 - 160, Gdx.graphics.getHeight()/2 - 85);
    //        SettingsButton.setPosition(Gdx.graphics.getWidth()/2 - 160, Gdx.graphics.getHeight()/2
    // - 165);
    SettingsButton.setPosition(
        Gdx.graphics.getWidth() / 2 - 160, Gdx.graphics.getHeight() / 2 - 300);
    //        QuitButton.setPosition(Gdx.graphics.getWidth()/2 - 160, Gdx.graphics.getHeight()/2 -
    // 245);
    QuitButton.setPosition(Gdx.graphics.getWidth() / 2 - 160, Gdx.graphics.getHeight() / 2 - 450);
    stage.addActor(PlayButton);
    // stage.addActor(ContinueButton);
    stage.addActor(SettingsButton);
    stage.addActor(QuitButton);

    PlayButton.addListener(
        new ChangeListener() {
          public void changed(ChangeEvent event, Actor actor) {
            select.play();
            PlayButton.setText("Starting new game");
            openingtheme.stop();
            game.setScreen(game.introscreen);
          }
        });
    SettingsButton.addListener(
        new ChangeListener() {
          public void changed(ChangeEvent event, Actor actor) {
            // System.out.println("Clicked! Is checked: " + button.isChecked());
            select.play();
            if (game.state.volume == 0f) {
              game.state.volume = .7f;
              openingtheme.play();
              openingtheme.setVolume(game.state.volume);
              SettingsButton.setText("Mute");
            } else {
              game.state.volume = 0f;
              openingtheme.stop();
              SettingsButton.setText("Unmute");
            }

            // TODO make this mute and unmute the non existant sound
            // mute and unmute;
          }
        });
    QuitButton.addListener(
        new ChangeListener() {
          public void changed(ChangeEvent event, Actor actor) {
            select.play();
            openingtheme.stop();
            QuitButton.setText("Quitting");
            // TODO make this quit the correct way
            System.exit(0);
          }
        });
  }