Java 类com.badlogic.gdx.scenes.scene2d.ui.TextButton 实例源码

项目:LD38-Compo    文件:LudumDare38.java   
private void createToolTip()
{
    Skin skin = new Skin();
    Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
    pixmap.setColor(Color.WHITE);
    pixmap.fill();
    skin.add("white", new Texture(pixmap));
    skin.add("default", new BitmapFont());

    TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
    textButtonStyle.up = skin.newDrawable("white", new Color(0, 0, 0, 1));
    textButtonStyle.font = skin.getFont("default");
    skin.add("default", textButtonStyle);

    labelToolTip = new TextButton("TEST", skin);
    labelToolTip.setX(5);
    labelToolTip.setY(5);
    labelToolTip.setWidth(125);
    labelToolTip.setVisible(false);
    labelToolTip.getLabel().setWrap(true);
    labelToolTip.setHeight(labelToolTip.getLabel().getHeight());
    group.addActor(labelToolTip);
}
项目:LD38-Compo    文件:LudumDare38.java   
private void createResetButton()
{
    Skin skin = new Skin();
    Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
    pixmap.setColor(Color.WHITE);
    pixmap.fill();
    skin.add("white", new Texture(pixmap));
    skin.add("default", new BitmapFont());

    TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
    textButtonStyle.up = skin.newDrawable("white", new Color(0, 0, 0, 1));
    textButtonStyle.font = skin.getFont("default");
    skin.add("default", textButtonStyle);

    btnReset = new TextButton("RESET", skin);
    btnReset.setX(5);
    btnReset.setY(Gdx.graphics.getHeight() - 25);
    btnReset.setWidth(60);
    btnReset.setVisible(true);
    group.addActor(btnReset);
}
项目:LD38-Compo    文件:LudumDare38.java   
private void createUndoButton()
{
    Skin skin = new Skin();
    Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
    pixmap.setColor(Color.WHITE);
    pixmap.fill();
    skin.add("white", new Texture(pixmap));
    skin.add("default", new BitmapFont());

    TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
    textButtonStyle.up = skin.newDrawable("white", new Color(0, 0, 0, 1));
    textButtonStyle.font = skin.getFont("default");
    skin.add("default", textButtonStyle);

    btnUndo = new TextButton("UNDO", skin);
    btnUndo.setX(70);
    btnUndo.setY(Gdx.graphics.getHeight() - 25);
    btnUndo.setWidth(60);
    btnUndo.setVisible(true);
    group.addActor(btnUndo);
}
项目:Hexpert    文件:ObjectiveDialog.java   
public ObjectiveDialog(Skin skin, Hexpert hexpert) {
    super(hexpert, skin);
    getBackground().setMinWidth(1000);

    final TextButton textButtonOK = new TextButton(hexpert.i18NBundle.get("ok"), skin);

    textButtonOK.addListener(new ClickListener(){

        @Override
        public void clicked(InputEvent event, float x, float y) {
            textButtonOK.setChecked(false);
        }
    });
    setObject(textButtonOK, null);
    getButtonTable().add(textButtonOK);

    getContentTable().defaults().pad(5, 0, 5, 15);
    getContentTable().top();
}
项目:feup-lpoo-armadillo    文件:NetworkingMenuScreen.java   
/**
 * Adds the Achievements Button to the Networking Menu.
 *
 * @param table The table to where the Achievements button will be added.
 */
private void createAchievementButton(Table table) {
    TextButton achievementsButton = new TextButton("Achievements", skin1);

    achievementsButton.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            gameServices.showAchievements();

        }
    });
    table.add(achievementsButton).size(BUTTON_WIDTH, DEFAULT_BUTTON_SIZE).pad(BUTTON_EDGE).row();
}
项目:feup-lpoo-armadillo    文件:NetworkingMenuScreen.java   
/**
 * Adds the Sign In / Sign Out Button to the Networking Menu.
 *
 * @param table The table to where the button will be added.
 */
private void createSignInBtn(Table table) {
    final TextButton signInButton = new TextButton(
            gameServices.isSignedIn() ? "Sign Out" : "Sign In!", skin1);

    signInButton.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            if (gameServices.isSignedIn()) {
                gameServices.signOut();
                signInButton.setText("Sign In!");
            } else {
                gameServices.signIn();
                signInButton.setText("Sign Out");
            }
        }
    });
    table.add(signInButton).size(BUTTON_WIDTH, DEFAULT_BUTTON_SIZE).pad(BUTTON_EDGE).row();
}
项目:feup-lpoo-armadillo    文件:LeaderboardMenuScreen.java   
/**
 * {@inheritDoc}
 */
@Override
protected TextButton addBackBtn(boolean style) {
    TextButton back = new TextButton("Back", (style ? skin2 : skin1));

    back.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            game.setScreen(new NetworkingMenuScreen(game));
        }
    });

    return back;
}
项目:feup-lpoo-armadillo    文件:LevelMenuScreen.java   
/**
 * Function used to create the Level Buttons and associate them to a given table, organized.
 * It also adds Listeners to the Level buttons.
 *
 * @param table Table where the Level Buttons will be organized.
 */
private void createLevelButtons(Table table) {

    for (int i = 1; i <= game.getNumMaps(); ++i) {
        levelButtons.add(new TextButton(String.valueOf(i), skin2));

        table.add(levelButtons.get(i - 1)).size(BUTTON_SIDE, BUTTON_SIDE).pad(BUTTON_EDGE);

        //Adding the button's listener
        final int j = (i - 1);
        addLevelListener(j);

        if ((i % BUTTONS_PER_LINE) == 0)
            table.row();
    }
}
项目:retro-reversi    文件:MainMenuView.java   
private void addButtons() {
    buttonTable = new Table();
    buttonTable.bottom();
    buttonTable.setFillParent(true);

    singlePlayer = new TextButton("\n  Single Player  \n", game.getSkin());
    multiPlayer = new TextButton("\n  Multi Player  \n", game.getSkin());
    achievements = new TextButton("\n  Achievements  \n", game.getSkin());
    sign = new TextButton(game.getPlayServices().isSignedIn() ?  "  Sign Out  " : "  Sign In  ", game.getSkin());
    sign.setColor(game.SECONDARY_COLOR);

    buttonTable.add(singlePlayer).center().padBottom(40);
    buttonTable.row();
    buttonTable.add(multiPlayer).center().padBottom(40);
    buttonTable.row();
    buttonTable.add(achievements).center().padBottom(40);
    buttonTable.row();
    buttonTable.add(sign).center().padBottom(40);

    stage.addActor(buttonTable);
}
项目:GDX-Engine    文件:TabPane.java   
public void addTab(String tabTitle, final ITabContent tabContent,
        Skin skin) {

    TextButton button = new TextButton(tabTitle, skin);
    button.align(Align.left);
    //button.setFillParent(true);
    button.addListener(new ChangeListener() {
        @Override
        public void changed(ChangeEvent event, Actor actor) {
            tabContent.setContent(content);
            content.pack();
            setWidth(preferedContentWidth);
            setHeight(preferedContentHeight);

        }
    });

    tabHeaders.add(button);
    contents.add(tabContent);

    preferedContentWidth = Math.max(preferedContentWidth, tabContent.getWidth());
    preferedContentHeight = Math.max(preferedContentHeight, tabContent.getHeight() + tabHeaders.get(0).getHeight());
}
项目:GDX-Engine    文件:BuildWeaponGUI.java   
@Override
   protected void onBuild(Skin skin) {
btnAddGun = new TextButton("Add Gun Lv.1 ($" + GameSpecs.gun_cost_first
    + ")", skin);
row().fill().expandX();
add(btnAddGun).expandX();
btnAddCanon = new TextButton("Add Canon Lv.1 ($"
    + GameSpecs.canon_cost_first + ")", skin);
row().fill().expandX();
add(btnAddCanon).expandX();
btnAddSlower = new TextButton("Add Slower Lv.1 ($"
    + GameSpecs.slower_cost_first + ")", skin);
row().fill().expandX();
add(btnAddSlower).expandX();
super.onBuild(skin);
   }
项目:GDX-Engine    文件:GameDialog.java   
public GameDialog(Skin skin) {
super("", skin);

waveLevel = new Label("", skin);
monsHP = new Label("", skin);
monsBonus = new Label("", skin);
monsSpeed = new Label("", skin);
monsNumber = new Label("", skin);
btnOK = new TextButton("Okay, Let them come!", skin);
btnOK.addListener(new ChangeListener() {

    @Override
    public void changed(ChangeEvent event, Actor actor) {
    // TODO Auto-generated method stub
    setVisible(false);

    }
});
setTitle(" There are more monsters are coming to you... ");
   }
项目:Cubes_2    文件:MultiplayerConnectMenu.java   
public MultiplayerConnectMenu() {
  super();
  title = new Label(Localization.get("menu.multiplayer.title"), skin.get("title", Label.LabelStyle.class));
  address = new TextField("", skin);
  address.setMessageText(Localization.get("menu.multiplayer.address"));
  port = new TextField("", skin);
  port.setMessageText(Localization.get("menu.multiplayer.port", 24842)); //Not "Settings.getIntegerSettingValue(Settings.NETWORKING_PORT)" because the port is set on the server
  port.setTextFieldFilter(new TextField.TextFieldFilter.DigitsOnlyFilter());
  connect = new TextButton(Localization.get("menu.multiplayer.connect"), skin);
  back = MenuTools.getBackButton(this);

  connect.addListener(new ChangeListener() {
    @Override
    public void changed(ChangeEvent event, Actor actor) {
      Adapter.setMenu(new MultiplayerLoadingMenu(address.getText().isEmpty() ? "localhost" : address.getText(), port.getText().isEmpty() ? 24842 : Integer.parseInt(port.getText())));
    }
  });

  stage.addActor(title);
  stage.addActor(address);
  stage.addActor(port);
  stage.addActor(connect);
  stage.addActor(back);
}
项目:blueirisviewer    文件:MainOptionsWnd.java   
private void AddWindowButton(final UIElement window, String buttonText, Skin skin, Table table)
{
    final TextButton btn = new TextButton(buttonText, skin);

    btn.addListener(new ChangeListener()
    {
        @Override
        public void changed(ChangeEvent event, Actor actor)
        {
            if (window.isShowing())
                window.hide();
            else
                window.show();
        }
    });

    table.add(btn);
    table.row();
}
项目:Hexpert    文件:LockedDialog.java   
public LockedDialog(int currentGoals, int goalsNeeded, Hexpert hexpert, Skin skin) {
    super(hexpert, skin.get("gray", WindowStyle.class));
    getBackground().setMinWidth(1000);
    getBackground().setMinHeight(350);

    getContentTable().defaults().pad(25);

    TextButton.TextButtonStyle txtButtonStyle = skin.get("gray", TextButton.TextButtonStyle.class);

    Label label = new Label(hexpert.i18NBundle.format("locked_left", currentGoals, goalsNeeded), skin);
    getContentTable().add(label).top();

    final TextButton textButtonOK = new TextButton(hexpert.i18NBundle.get("ok"), txtButtonStyle);

    textButtonOK.addListener(new ClickListener() {

        @Override
        public void clicked(InputEvent event, float x, float y) {
            textButtonOK.setChecked(false);
        }
    });
    setObject(textButtonOK, null);
    getButtonTable().add(textButtonOK);
}
项目:MMORPG_Prototype    文件:MenuDialog.java   
public MenuDialog(UserInterface linkedInterface)
{
    super("Menu", Settings.DEFAULT_SKIN);

    Button closeButton = new CloseButton(this);
    getTitleTable().add(closeButton).size(15, 15).padRight(-5).top().right();

    TextButton characterChangeButton = ButtonCreator.createTextButton("Change character",
            () -> linkedInterface.userWantsToChangeCharacter());
    TextButton logOutButton = ButtonCreator.createTextButton("Log out", () -> linkedInterface.userWantsToLogOut());
    TextButton disconnectButton = ButtonCreator.createTextButton("Disconnect", () -> linkedInterface.userWantsToDisconnect());
    TextButton exitButton = ButtonCreator.createTextButton("Exit", () -> Gdx.app.exit());

    getContentTable().add(characterChangeButton);
    getContentTable().row();
    getContentTable().add(logOutButton);
    getContentTable().row();
    getContentTable().add(disconnectButton);
    getContentTable().row();
    getContentTable().add(exitButton);
    getContentTable().row();

    DialogUtils.centerPosition(this);
    pack();
}
项目:arcadelegends-gg    文件:GameOverScreen.java   
private void createComponents()
{
    btBackToMainMenu = new TextButton("Back to Main Menu", skin);
    btBackToMainMenu.center();
    btBackToMainMenu.setWidth(600);
    btBackToMainMenu.setHeight(80);
    btBackToMainMenu.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            AL.getGame().setScreen(AL.getScreenManager().get(MainMenuScreen.class));
        }
    });
    btBackToMainMenu.setPosition(1920 / 2 - 300, 1080 / 2 + 40);
    stage.addActor(btBackToMainMenu);

    endgameLabel = new Label(endgameText, skin);
    endgameLabel.setWidth(600);
    endgameLabel.setHeight(80);
    endgameLabel.setAlignment(Align.center);
    endgameLabel.setPosition(1920 / 2 - 300, 1080 / 1.5f);
    stage.addActor(endgameLabel);
}
项目:ExamensArbeteTD    文件:LoseStage.java   
private void initLoseStage() {

    setViewport(new ScreenViewport(getCamera()));
    getViewport().update(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    getViewport().apply(true);

    Label youLoseLbl = new Label("You lost" , Assets._skin , "fontVeraBd24" ,"white");
    playAgainBtn = new TextButton("Play Again", Assets._skin , "menu");
    mainMenuBtn = new TextButton("Main Menu", Assets._skin ,  "menu");
    Table container = new Table(Assets._skin);
    youLoseLbl.setColor(Color.RED);
    container.add(youLoseLbl).spaceBottom(100).row();
    container.add(playAgainBtn).align(Align.left).spaceBottom(20).row();
    container.add(mainMenuBtn).align(Align.left);
    container.setSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    container.setFillParent(true);
    addActor(container);
}
项目:ExamensArbeteTD    文件:WinStage.java   
private void initWinStage() {
    setViewport(new ScreenViewport(getCamera()));
    getViewport().update(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    getViewport().apply(true);

    Label youWinLabel = new Label("You Won!" , Assets._skin , "fontVeraBd24" , "white");
    playAgainBtn = new TextButton("Play Again", Assets._skin , "menu");
    mainMenuBtn = new TextButton("Main Menu", Assets._skin , "menu");
    Table container = new Table(Assets._skin);
    youWinLabel.setColor(Color.GREEN);
    container.add(youWinLabel).spaceBottom(100).row();
    container.add(playAgainBtn).align(Align.left).spaceBottom(20).row();
    container.add(mainMenuBtn).align(Align.left);
    container.setSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    container.setFillParent(true);
    addActor(container);
}
项目:ExamensArbeteTD    文件:PauseWindow.java   
public PauseWindow(String title, Skin skin) {
    super(title, skin);
       this.setVisible(false);
       primaryMenu = new Table(skin);
       settingsPanel = new SettingsPanel(skin);
       _okButton  = new TextButton("OK" , skin , "menu");
       settingsPanel.add(_okButton);
       _resumeButton = new TextButton("Resume",Assets._skin , "menu");
       _mainMenuButton = new TextButton("Main Menu",Assets._skin , "menu");
       _settingsButton = new TextButton("Settings",Assets._skin , "menu");

       primaryMenu.add(_resumeButton).padBottom(20f).row();
       primaryMenu.add(_settingsButton).padBottom(20f).row();
       primaryMenu.add(_mainMenuButton);
       this.add(primaryMenu).align(Align.center).fill();
}
项目:Hexpert    文件:ActionDialog.java   
public ActionDialog(Label text, Action action, I18NBundle bundle, Skin skin, Hexpert hexpert) {
    super(hexpert, skin);
    this.action = action;

    getBackground().setMinWidth(1000);
    getBackground().setMinHeight(400);
    text.setWrap(true);
    text.setAlignment(Align.center);

    getContentTable().add(text).width(getBackground().getMinWidth()).expandX();

    getButtonTable().defaults().width(200).height(120).pad(15);

    TextButton textButtonYes = new TextButton(bundle.get("yes"), skin);
    getButtonTable().add(textButtonYes);
    setObject(textButtonYes, 1);
    TextButton textButtonNo = new TextButton(bundle.get("no"), skin);
    getButtonTable().add(textButtonNo);
    setObject(textButtonNo, null);
}
项目:Cubes    文件:ServerSetupMenu.java   
public ServerSetupMenu(final Save save) {
  super();
  title = new Label(Localization.get("menu.server.title"), skin.get("title", Label.LabelStyle.class));
  saveLabel = new Label(Localization.get("menu.server.save", save.name), skin);
  saveLabel.setAlignment(Align.center);
  port = new TextField("", skin);
  port.setMessageText(Localization.get("menu.server.port", Settings.getIntegerSettingValue(Settings.NETWORKING_PORT)));
  port.setTextFieldFilter(new TextField.TextFieldFilter.DigitsOnlyFilter());
  start = new TextButton(Localization.get("menu.server.start"), skin);
  back = MenuTools.getBackButton(this);

  start.addListener(new ChangeListener() {
    @Override
    public void changed(ChangeEvent event, Actor actor) {
      int p = port.getText().isEmpty() ? Settings.getIntegerSettingValue(Settings.NETWORKING_PORT) : Integer.parseInt(port.getText());
      Adapter.setMenu(new ServerRunningMenu(save, p));
    }
  });

  stage.addActor(title);
  stage.addActor(saveLabel);
  stage.addActor(port);
  stage.addActor(start);
  stage.addActor(back);
}
项目:Cubes    文件:SingleplayerSaveDeleteMenu.java   
public SingleplayerSaveDeleteMenu(final Save save) {
  title = new Label(Localization.get("menu.singleplayer.delete.title"), skin.get("title", Label.LabelStyle.class));
  text = new Label(Localization.get("menu.singleplayer.delete.text", save.name), skin);
  delete = new TextButton(Localization.get("menu.singleplayer.delete.delete", save.name), skin);
  back = MenuTools.getBackButton(this);

  text.setAlignment(Align.center);

  delete.addListener(new ChangeListener() {
    @Override
    public void changed(ChangeEvent event, Actor actor) {
      ClientSaveManager.deleteSave(save);
      Menu prev = MenuManager.getPrevious(SingleplayerSaveDeleteMenu.this);
      if (!(prev instanceof SingleplayerSavesMenu)) return;
      ((SingleplayerSavesMenu) prev).updateSavesList();
      Adapter.setMenu(prev);
    }
  });

  stage.addActor(title);
  stage.addActor(text);
  stage.addActor(delete);
  stage.addActor(back);
}
项目:Cubes    文件:MultiplayerConnectMenu.java   
public MultiplayerConnectMenu() {
  super();
  title = new Label(Localization.get("menu.multiplayer.title"), skin.get("title", Label.LabelStyle.class));
  address = new TextField("", skin);
  address.setMessageText(Localization.get("menu.multiplayer.address"));
  port = new TextField("", skin);
  port.setMessageText(Localization.get("menu.multiplayer.port", 24842)); //Not "Settings.getIntegerSettingValue(Settings.NETWORKING_PORT)" because the port is set on the server
  port.setTextFieldFilter(new TextField.TextFieldFilter.DigitsOnlyFilter());
  connect = new TextButton(Localization.get("menu.multiplayer.connect"), skin);
  back = MenuTools.getBackButton(this);

  connect.addListener(new ChangeListener() {
    @Override
    public void changed(ChangeEvent event, Actor actor) {
      Adapter.setMenu(new MultiplayerLoadingMenu(address.getText().isEmpty() ? "localhost" : address.getText(), port.getText().isEmpty() ? 24842 : Integer.parseInt(port.getText())));
    }
  });

  stage.addActor(title);
  stage.addActor(address);
  stage.addActor(port);
  stage.addActor(connect);
  stage.addActor(back);
}
项目:Catan    文件:CatanWindow.java   
private void init() {
    // Make the window around 3/4 of the screen
    setSize(width, height);

    // Position window in the middle
    setPosition(Gdx.graphics.getWidth() / 2 - getWidth() / 2, Gdx.graphics.getHeight() / 2 - getHeight() / 2);

    // Center title
    getTitleLabel().setAlignment(Align.center);

    // Create the close button
    if (getTitleLabel().getText().length != 0) {
        closeButton = new TextButton("X", getSkin());
        closeButton.setSize(20, 20);
        closeButton.addListener(new ChangeListener() {
            @Override
            public void changed(ChangeEvent event, Actor actor) {
                closeButton.setChecked(false);
                close();
            }
        });
        getTitleTable().addActor(closeButton);
        closeButton.setPosition(getWidth() - closeButton.getWidth() - 5, 0);
    }

    getTitleTable().getCells().get(0).expandY().fillY();

    setMovable(false);
    setModal(true);

    row();
}
项目:Catan    文件:BrowseGamesWindow.java   
public BrowseGamesWindow() {
    super("Browse Games", CatanGame.skin);

    games = new ArrayList<>();
    gameList = new List<>(CatanGame.skin);

    add(gameList).pad(20).width(300).row();

    TextButton loadGame = new TextButton("Load Game", CatanGame.skin);
    loadGame.addListener(new ChangeListener() {
        @Override
        public void changed(ChangeEvent event, Actor actor) {
            if (gameListener != null) {
                gameListener.onGameSelected(gameList.getSelected());
                close();
            }
        }
    });
    add(loadGame).right().pad(20);

    setSize(400, 400);
    setPosition(Gdx.graphics.getWidth() / 2 - getWidth() / 2, Gdx.graphics.getHeight() / 2 - getHeight() / 2);
}
项目:Cubes    文件:MenuTools.java   
public static TextButton getBackButton(final Menu menu) {
  TextButton textButton = new TextButton(Localization.get("menu.general.back"), Menu.skin);
  textButton.addListener(new ChangeListener() {
    @Override
    public void changed(ChangeEvent event, Actor actor) {
      Menu prev = MenuManager.getPrevious(menu);
      if (prev == null) return;
      Adapter.setMenu(prev);
    }
  });
  return textButton;
}
项目:Catan    文件:PlayProgressCardWindow.java   
public PlayProgressCardWindow(String title, Skin skin, List<ProgressCardType> hand, GamePhase currentPhase, boolean isMyTurn, boolean firstBarbarianAttack) {
    super(title, skin);

    if (hand.isEmpty()) {
        add(new Label("Your hand is empty", skin)).pad(10);
    }

    // adds images of the card and the associated button that will play the card
    for (ProgressCardType type : hand) {
        Table cardTable = new Table(CatanGame.skin);

        // TODO: add image of correct progress card
        // cardTable.add(cardMap.get(type)).padBottom(10).row();

        TextButton playCard = new TextButton("Play " + type.toString().toLowerCase(), CatanGame.skin);
        playCard.addListener(new ChangeListener() {
            @Override
            public void changed(ChangeEvent event, Actor actor) {
                if (playProgressCardListener != null) {
                    playProgressCardListener.onCardChosen(type);
                    remove();
                } 
            }
        });
        playCard.setDisabled(!isLegalPlay(type, currentPhase, isMyTurn, firstBarbarianAttack)); 

        cardTable.add(playCard).pad(5);

        add(cardTable).pad(5);
    }

    pack();

    // set position on screen
    setPosition(Gdx.graphics.getWidth() / 2 - getWidth() / 2, Gdx.graphics.getHeight() / 2 - getHeight() / 2);

    // enable moving the window
    setMovable(true);
}
项目:Catan    文件:MenuScreen.java   
private void setupButton(TextButton pTextButton, ScreenKind pScreenkind) {
    // add listener to button
    pTextButton.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            aGame.clickSound.play(0.2F);
            pTextButton.setChecked(false);
            aGame.switchScreen(pScreenkind);
        }
    });

    aMenuTable.add(pTextButton).padLeft(25).padRight(25).left();
}
项目:feup-lpoo-armadillo    文件:CustomizeMenuScreen.java   
/**
 * Function responsible for creating the static Elements of the Stage (Scroller and Back Button), and organize them.
 * Also adds Listeners to its Elements.
 *
 * @param table      Table where the static elements will be organized.
 * @param skinsTable Table containing the level buttons, that will be associated to the scroller.
 */
private void createStaticElements(Table table, Table skinsTable) {
    TextButton back = addBackBtn(true);

    //Creating and setting the Scroller
    ScrollPane scroller = new ScrollPane(skinsTable, skin1);
    scroller.getStyle().background = null;

    table.add(back).size(DEFAULT_BUTTON_SIZE, DEFAULT_BUTTON_SIZE).top().left()     .padLeft(SIDE_DISTANCE).padTop(TOP_EDGE / 3).row();
    table.add(scroller).fill().expand().padBottom(SCROLLER_DISTANCE);
}
项目:feup-lpoo-armadillo    文件:MainMenuScreen.java   
/**
 * Adds the Exit Button to the Main Menu.
 *
 * @param table The table to where the Exit button will be added.
 */
private void addExitButton(Table table) {
    TextButton exitButton = new TextButton("Exit", skin1);
    exitButton.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            Gdx.app.exit();
        }
    });
    table.add(exitButton).size(BUTTON_WIDTH, DEFAULT_BUTTON_SIZE).pad(BUTTON_EDGE).row();
}
项目:feup-lpoo-armadillo    文件:MainMenuScreen.java   
/**
 * Adds the Networking Button to the Main Menu.
 *
 * @param table The table to where the Networking button will be added.
 */
private void addNetworkingButton(Table table) {
    TextButton networkingButton = new TextButton("Networking", skin1);
    networkingButton.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            game.setScreen(new NetworkingMenuScreen(game));
        }
    });
    table.add(networkingButton).size(BUTTON_WIDTH, DEFAULT_BUTTON_SIZE).pad(BUTTON_EDGE).row();
}
项目:feup-lpoo-armadillo    文件:MainMenuScreen.java   
/**
 * Adds the Options Button to the Main Menu.
 *
 * @param table The table to where the Options button will be added.
 */
private void addOptionsButton(Table table) {
    TextButton optionsButton = new TextButton("Options", skin1);
    optionsButton.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            game.setScreen(new CustomizeMenuScreen(game));
        }
    });
    table.add(optionsButton).size(BUTTON_WIDTH, DEFAULT_BUTTON_SIZE).pad(BUTTON_EDGE).row();
}
项目:feup-lpoo-armadillo    文件:MainMenuScreen.java   
/**
 * Adds the play Button to the Main Menu.
 *
 * @param table The table to where the play button will be added.
 */
private void addPlayButton(Table table) {
    TextButton playButton = new TextButton("Play", skin1);
    playButton.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            game.setScreen(new LevelMenuScreen(game));
        }
    });
    table.add(playButton).size(BUTTON_WIDTH, DEFAULT_BUTTON_SIZE).pad(BUTTON_EDGE).row();
}
项目:feup-lpoo-armadillo    文件:NetworkingMenuScreen.java   
/**
 * Function responsible for creating and setting the Networking Buttons.
 * It also sets the buttons Layout in the given table.
 *
 * @param table Table where the Menu buttons will be organized
 */
@Override
protected void createMenuButtons(Table table) {
    table.bottom();

    createSignInBtn(table);
    createAchievementButton(table);
    createLeaderboardButton(table);

    TextButton back = addBackBtn(false);
    table.add(back).size(BUTTON_WIDTH, DEFAULT_BUTTON_SIZE).pad(BUTTON_EDGE);

    table.padBottom(BOTTOM_EDGE);
}
项目:feup-lpoo-armadillo    文件:OptionsMenu.java   
/**
 * Function that adds an Exit Button to the Stage.
 */
protected void addExitBtn() {
    TextButton exitBtn = new TextButton("Exit", this.skin);

    exitBtn.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            game.setScreen(new LevelMenuScreen(game));
        }
    });

    table.add(exitBtn).size(BUTTON_WIDTH, BUTTON_HEIGHT);
}
项目:feup-lpoo-armadillo    文件:OptionsMenu.java   
/**
 * Function that adds a Restart Button to the Stage.
 */
protected void addRestartBtn() {
    TextButton restartBtn = new TextButton("Restart", skin);

    restartBtn.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            startLevel();
        }
    });

    table.add(restartBtn).size(BUTTON_WIDTH, BUTTON_HEIGHT).padBottom(BUTTON_DISTANCE).row();
}
项目:feup-lpoo-armadillo    文件:OptionsMenu.java   
/**
 * Function that adds a Button responsible for showing the Leaderboard of the current Level.
 */
protected void addLeaderboardBtn() {
    TextButton leaderboardBtn = new TextButton("Leaderboard", skin);

    leaderboardBtn.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            game.getGameServices().showScores(hud.getCurrentLevel() - 1);
        }
    });

    table.add(leaderboardBtn).size(BUTTON_WIDTH, BUTTON_HEIGHT).padBottom(BUTTON_DISTANCE).row();
}
项目:feup-lpoo-armadillo    文件:OptionsMenu.java   
/**
 * Function that adds a Resume Button to the Stage.
 */
protected void addResumeBtn() {
    TextButton resumeBtn = new TextButton("Resume", skin);

    resumeBtn.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            togglePause();
        }
    });

    table.add(resumeBtn).size(BUTTON_WIDTH, BUTTON_HEIGHT).padBottom(BUTTON_DISTANCE).row();
}
项目:Hexpert    文件:FreeridingDialog.java   
public FreeridingDialog(final Hexpert hexpert, Skin skin)
{
    super(hexpert, skin.get("gold", WindowStyle.class));

    getBackground().setMinWidth(1400);
    I18NBundle i18N = hexpert.i18NBundle;
    Label lblRate = new Label(i18N.get("freerider"), skin.get("bigger", Label.LabelStyle.class));
    lblRate.setAlignment(Align.center);
    lblRate.setWrap(true);
    getContentTable().add(lblRate).width(1200);

    TextButton.TextButtonStyle goldenStyle = skin.get("gold", TextButton.TextButtonStyle.class);


    TextButton textButtonRate = new TextButton(i18N.get("rate"), goldenStyle);
    getButtonTable().add(textButtonRate).width(textButtonRate.getLabelCell().getPrefWidth() + 30);


    TextButton textButtonNo = new TextButton(i18N.get("no"), goldenStyle);
    getButtonTable().add(textButtonNo);
    setObject(textButtonNo, null);

    textButtonRate.addListener(new ClickListener(){
        @Override
        public void clicked(InputEvent event, float x, float y) {
            hexpert.playServices.rateGame();
            hide();
        }
    });

    setObject(textButtonRate, null);
}