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

项目:Planet-Generator    文件:ObjectEditor.java   
public ObjectEditor(Scene scene, String objectName) {
    this.scene = scene;

    top = new Table();
    top.add(new VisLabel(objectName)).expandX().pad(0, 20, 0, 20);

    VisTextButton deleteObject = new VisTextButton("Delete");
    deleteObject.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            hasDeleteBeenPressed = true;
            delete();
        }
    });
    top.add(deleteObject).pad(0, 20, 0, 20);

    add(top).padTop(80).colspan(4).row();

    bottom = new Table();
}
项目:Planet-Generator    文件:SceneUI.java   
@Override
protected void initialize() {
    Table topButtonBar = new Table();
    topButtonBar.setFillParent(true);

    VisTextButton showEditorButton = new VisTextButton("Show Editor");
    showEditorButton.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            showEditorClicked();
        }
    });
    topButtonBar.top().left().add(showEditorButton).pad(7);

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

    stage.addActor(topButtonBar);
}
项目:Catan    文件:ChooseDiceResultWindow.java   
private Table setupRedDiceOption(int diceNumber) {
    Table redDiceOption = new Table();
    redDiceOption.setBackground(redBackground);

    redDiceOption.add(new Label("" + diceNumber, CatanGame.skin));

    redDiceOption.setTouchable(Touchable.enabled); 
    redDiceOption.addListener(new ClickListener(){
        @Override
        public void clicked(InputEvent event, float x, float y) {
            if (chosenRedDice == diceNumber) {
                System.out.println("discard choice of " + diceNumber);
                chosenRedDice = 0;
                enableAllTouchablesRed();
            } else {
                System.out.println("choose " + diceNumber);
                chosenRedDice = diceNumber;
                disableAllTouchablesRed();
                redDiceOption.setTouchable(Touchable.enabled);
                redDiceOption.setBackground(redBackground);
            }
        }
    });

    return redDiceOption;
}
项目:Catan    文件:ChooseDiceResultWindow.java   
private Table setupYellowDiceOption(int diceNumber) {
    Table yellowDiceOption = new Table();
    yellowDiceOption.setBackground(yellowBackground);

    yellowDiceOption.add(new Label("" + diceNumber, CatanGame.skin));

    yellowDiceOption.setTouchable(Touchable.enabled); 
    yellowDiceOption.addListener(new ClickListener(){
        @Override
        public void clicked(InputEvent event, float x, float y) {
            if (chosenYellowDice == diceNumber) {
                System.out.println("discard choice of " + diceNumber);
                chosenYellowDice = 0;
                enableAllTouchablesYellow();
            } else {
                System.out.println("choose " + diceNumber);
                chosenYellowDice = diceNumber;
                disableAllTouchablesYellow();
                yellowDiceOption.setTouchable(Touchable.enabled);
                yellowDiceOption.setBackground(yellowBackground);
            }
        }
    });

    return yellowDiceOption;
}
项目:feup-lpoo-armadillo    文件:CustomizeMenuScreen.java   
/**
 * Function used to create the Skins' Buttons and Labels and associate them to a given table, organized.
 * It also adds Listeners to the Skins' Buttons.
 *
 * @param table Table where the Skins' Labels and Buttons will be organized.
 */
private void createSkins(Table table) {
    for (int i = 0; i < game.getNumSkins(); ++i) {

        //Adding Buttons and Labels to the Arrays
        skinButtons.add(new Button(new TextureRegionDrawable(new TextureRegion(game.getAssetManager().get("big_skins/skin" + (i < 10 ? "0" : "") + i + ".png", Texture.class)))));
        skinLabels.add(new Label("Current", skin1));

        final int j = i; //Needed for Listener initialization
        skinButtons.get(i).addListener(new ClickListener() {
            @Override
            public void clicked(InputEvent event, float x, float y) {
                setCurrentLabel(j);
            }
        });

        table.add(skinButtons.get(i)).size(BUTTON_SIZE, BUTTON_SIZE).pad(IMAGE_EDGE);
    }
    table.row();

    for (int i = 0; i < game.getNumSkins(); ++i)
        table.add(skinLabels.get(i));

    initializeCurrentSkin();
}
项目:feup-lpoo-armadillo    文件:CustomizeMenuScreen.java   
/**
 * {@inheritDoc}
 */
@Override
public void show() {
    super.show();

    //Table containing all the possibles Ball appearances
    Table skins = new Table();

    //Table containing the screen elements that shall not move with the scroller
    Table staticElements = new Table();
    staticElements.setFillParent(true);

    createSkins(skins);
    createStaticElements(staticElements, skins);

    stage.addActor(staticElements);
    Gdx.input.setInputProcessor(stage);
}
项目:feup-lpoo-armadillo    文件:HudMenu.java   
/**
 * Function used to initialize all the elements of the HUD and add the respective Listeners.
 */
private void initHUD() {
    Table hudTable = new Table();
    hudTable.setFillParent(true);

    Button pauseButton = new Button(new TextureRegionDrawable(
            new TextureRegion(game.getAssetManager().get("pause.png", Texture.class))));

    scoreText = new Label("0:00", skin);
    scoreText.setFontScale(FONT_SCALE, FONT_SCALE);

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

    hudTable.top();
    hudTable.add(scoreText).size(HUD_ELEMENTS_SIZE, HUD_ELEMENTS_SIZE).expandX()
            .left().fill().padLeft(HORIZONTAL_PAD).padTop(VERTICAL_PAD);
    hudTable.add(pauseButton).size(HUD_ELEMENTS_SIZE, HUD_ELEMENTS_SIZE).fill()
            .padRight(HORIZONTAL_PAD).padTop(VERTICAL_PAD);

    this.addActor(hudTable);
}
项目: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    文件: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();
    }
}
项目:Tower-Defense-Galaxy    文件:MessageWindow.java   
public MessageWindow(String message, BitmapFont font, float width, float height) {
    setTouchable(Touchable.enabled);
    setBounds(width / 2 - width / 4, height / 2 - height / 10, width / 2, height / 5);
    texture = new Texture("theme/basic/ui/Window.png");
    this.message = message;
    table = new Table();
    table.setSize(getWidth(), getHeight());
    table.align(Align.center | Align.top);
    table.setPosition(getX(), getY());
    Label label = new Label(message, new Label.LabelStyle(font, Color.BLACK));
    label.setWrap(true);
    label.setFontScale(0.7f);
    Label label2 = new Label("Tap to continue", new Label.LabelStyle(font, Color.BLACK));
    label2.setFontScale(0.6f);
    table.add(label).width(getWidth());
    table.row();
    table.add(label2).width(getWidth()).expandY();
    table.pad(0, 30, 0, 30);
}
项目:Cubes_2    文件:ScrollInventoryActor.java   
public ScrollInventoryActor(Inventory inventory, int slots) {
    defaults().space(4f);

    add(new Label(inventory.getDisplayName(), new LabelStyle(Fonts.hud, Color.WHITE)));
    row();

    inner = new Table();
    inner.defaults().space(4f);
    for (int i = 0; i < inventory.itemStacks.length; i++) {
        SlotActor slotActor = new SlotActor(inventory, i);
        inner.add(slotActor);

        if ((i + 1) % inventory.width == 0) {
            inner.row();
        }
    }
    inner.pack();

    scrollPane = new ScrollPane(inner);
    scrollPane.setScrollingDisabled(true, false);
    add(scrollPane).height(slots * CALIBRATION_PER_ROW).fill();
    row();
    pack();
}
项目:enklave    文件:ScreenChat.java   
public void addchatlocation(){
    grchatlocation = new VerticalGroup();
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd/HH:mm:ss");
    try {
        grchatlocation.addActor(addComment(sdf.parse("2016/5/17/13:34:23"),"adrian", Color.RED,"Welcome Chat!"));
        grchatlocation.addActor(addComment(sdf.parse("2016/5/17/13:34:23"),"adrian", Color.GREEN,"Location!"));
        grchatlocation.addActor(labelTest);
    } catch (ParseException e) {
        e.printStackTrace();
        Gdx.app.log("eroare","intra");
    }
    scrollchatpublic = new ScrollPane(grchatlocation);
    scrollchatpublic.layout();
    scrollchatpublic.setScrollingDisabled(true, false);
    scrollchatpublic.setFillParent(true);
    scrollchatpublic.setLayoutEnabled(true);
    tablechatpublic = new Table();
    tablechatpublic.setFillParent(false);
    tablechatpublic.add(scrollchatpublic).fill().expand();
    tablechatpublic.setBounds(WIDTH *0.05f,background1.getY(), WIDTH*0.9f,background1.getHeight() * 1.05f);
    groupbotttom.addActor(tablechatpublic);
    scrollchatpublic.setScrollPercentY(100);
    scrollchatpublic.act(Gdx.graphics.getDeltaTime());
    scrollchatpublic.updateVisualScroll();
}
项目: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();
}
项目:MMORPG_Prototype    文件:ShopBuyingDialog.java   
public ShopBuyingDialog(ShopItem item, UserInterface linkedInterface, PacketsSender packetsSender, long shopId)
{
    super(DialogUtils.humanReadableFromItemIdentifier(item.getItem().getIdentifier()), linkedInterface.getDialogs(),
            item.getItem().getId());
    this.item = item;
    totalPrice = new StringValueLabel<>("Total: ", getSkin(), item.getPrice());
    Texture texture = item.getItem().getTexture();
    Image image = new Image(texture);
    Table upperContainer = new Table();
    upperContainer.add(image).width(32).height(32).padRight(43);
    upperContainer.add(numberOfItemsField).width(40).align(Align.right);
    this.getContentTable().add(upperContainer).align(Align.left);
    this.getContentTable().row();
    this.getContentTable().add(totalPrice);
    this.getContentTable().row();
    Button buyButton = ButtonCreator.createTextButton("Buy", () -> tryToBuyAction(packetsSender, shopId, linkedInterface));
    this.getContentTable().add(buyButton);
    pack();
    DialogUtils.centerPosition(this);
}
项目:bobbybird    文件:LoadingState.java   
@Override
public void start() {
    finishedLoading = false;

    stage = new Stage(new ScreenViewport());

    skin = createSkin();

    Image image= new Image(skin, "bg");
    image.setScaling(Scaling.stretch);
    image.setFillParent(true);
    stage.addActor(image);

    root = new Table();
    root.setFillParent(true);
    stage.addActor(root);

    progressBar = new ProgressBar(0, 1, .01f, false, skin);
    progressBar.setAnimateDuration(.1f);
    root.add(progressBar).growX().expandY().pad(20.0f);
}
项目: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    文件:LeftSection.java   
public LeftSection(Skin skin) {
    this.setSkin(skin);

       Table moneyStatPanel = new StatPanel(skin);
       Image coin = new Image(skin , "coin");
       moneyLabel = new Label("",skin , "fontHemi20" , "white");
       moneyStatPanel.add(coin).pad(5).align(Align.left).expand().size(23 , 21);
       moneyStatPanel.add(moneyLabel).align(Align.right).pad(5 , 5 , 5 ,10).expand();
       this.add(moneyStatPanel).align(Align.right).size(120 , 30).spaceBottom(2).row();
       Table grayPanel = new GrayPanel(skin);
       _laserTowerIcon = new Image(skin , "laser-tower-icon");
       _plastmaTowerIcon = new Image(skin , "plastma-tower-icon");
       _missleTurretIcon = new Image(skin,"missile-tower-icon");

       _laserTowerTooltipTable = new LaserTowerTooltipTable(skin, TowerType.BASIC_LASER_TURRET);
       _plastmaTowerTooltipTable = new PlastmaTowerTooltipTable(skin, TowerType.PLASTMA_TOWER);
       _missileTowerTooltipTable = new MissileTowerTooltipTable(skin, TowerType.MISSILE_TURRET);

       _laserTowerIcon.addListener(_laserTowerTooltipTable.getTooltip());
       _plastmaTowerIcon.addListener(_plastmaTowerTooltipTable.getTooltip());
       _missleTurretIcon.addListener(_missileTowerTooltipTable.getTooltip());
       grayPanel.add(_laserTowerIcon).size(32,32).pad(10).align(Align.topLeft);
       grayPanel.add(_plastmaTowerIcon).size(32,32).pad(10).align(Align.topLeft);
       grayPanel.add(_missleTurretIcon).size(32, 32).pad(10).align(Align.topLeft).expand(32,32);
       this.add(grayPanel).expand();
}
项目: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();
}
项目:GangsterSquirrel    文件:MenuScreen.java   
public MenuScreen(MainGameClass game) {
    this.game = game;

    stage = new Stage(new ScreenViewport());
    Gdx.input.setInputProcessor(stage);

    skin = new Skin(Gdx.files.internal("skins/Flat_Earth_UI_Skin/flatearthui/flat-earth-ui.json"));

    progressBarStyle = skin.get("fancy", ProgressBar.ProgressBarStyle.class);
    TiledDrawable tiledDrawable = skin.getTiledDrawable("slider-fancy-knob").tint(skin.getColor("selection"));
    tiledDrawable.setMinWidth(0);
    progressBarStyle.knobBefore = tiledDrawable;

    sliderStyle = skin.get("fancy", Slider.SliderStyle.class);
    sliderStyle.knobBefore = tiledDrawable;

    layoutTable = new Table();
    layoutTable.top();
    layoutTable.setFillParent(true);
    layoutTable.pad(getPixelSizeFromDensityIndependentPixels(50));
}
项目:Cubes    文件:ScrollInventoryActor.java   
public ScrollInventoryActor(Inventory inventory, int slots) {
  defaults().space(4f);

  add(new Label(inventory.getDisplayName(), new LabelStyle(Fonts.hud, Color.WHITE)));
  row();

  inner = new Table();
  inner.defaults().space(4f);
  for (int i = 0; i < inventory.itemStacks.length; i++) {
    SlotActor slotActor = new SlotActor(inventory, i);
    inner.add(slotActor);

    if ((i + 1) % inventory.width == 0) {
      inner.row();
    }
  }
  inner.pack();

  scrollPane = new ScrollPane(inner);
  scrollPane.setScrollingDisabled(true, false);
  add(scrollPane).height(slots * CALIBRATION_PER_ROW).fill();
  row();
  pack();
}
项目:Hexpert    文件:TutorialDialog.java   
public TutorialDialog(Hexpert hexpert, Skin skin, boolean useScrollPane) {
    super(hexpert, skin);
    scrollContent = new Table();
    if(useScrollPane) {
        scrollPane = new ScrollPane(scrollContent, skin);
        getContentTable().add(scrollPane);
    }

    getButtonTable().defaults().pad(15);
    I18NBundle i18N = hexpert.i18NBundle;

    TextButton textButtonOk = new TextButton(i18N.get("ok"), skin);
    getButtonTable().add(textButtonOk);

    setObject(textButtonOk, null);
}
项目: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);
}
项目:retro-reversi    文件:MultiplayerMenuView.java   
private void addOptionsButtons() {
    buttonTable = new Table();
    buttonTable.bottom();
    buttonTable.setFillParent(true);

    localGameButton = new TextButton("\n  Local  \n", game.getSkin());
    onlineGameButton = new TextButton("\n    Online    \n", game.getSkin());
    checkGamesButton = new TextButton("\n  Check Games  \n", game.getSkin());
    backButton = new TextButton("Back", game.getSkin());

    buttonTable.add(localGameButton).center().padBottom(40);
    buttonTable.row();
    buttonTable.add(onlineGameButton).center().padBottom(40);
    buttonTable.row();
    buttonTable.add(checkGamesButton).center().padBottom(40);
    buttonTable.row();
    buttonTable.add(backButton).center().padBottom(40);
    backButton.setColor(Reversi.SECONDARY_COLOR);

    stage.addActor(buttonTable);
}
项目:blueirisviewer    文件:CameraLayoutWnd.java   
@Override
public void onUpdate(final Window window, final Table table)
{
    if (AllCameras == null && BlueIrisViewer.images != null)
    {
        AllCameras = BlueIrisViewer.images.GetCameraNamesStringArray();
        if (AllCameras != null)
            listAllCams.setItems(AllCameras);
    }
}
项目:ProjektGG    文件:BaseUIScreen.java   
@Override
public void show() {
    stage = new Stage(new ScreenViewport());
    mainTable = new Table();
    stage.addActor(mainTable);
    mainTable.setFillParent(true);

    mainTable.setDebug((boolean) game.showDebugStuff());

    game.setInputProcessor(stage);

    initUI();
}
项目: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);
}
项目: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   
/**
 * Function responsible for creating and setting the Menu Buttons.
 * It also sets the buttons Layout in the given table.
 *
 * @param table Table where the Menu buttons will be organized
 */
protected void createMenuButtons(Table table) {

    table.bottom();

    addPlayButton(table);
    addOptionsButton(table);
    addNetworkingButton(table);
    addExitButton(table);

    table.padBottom(BOTTOM_EDGE);
}
项目: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 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   
/**
 * {@inheritDoc}
 */
@Override
public void show() {
    super.show();

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

    createMenuButtons(table);

    stage.addActor(table);
}
项目: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);
}
项目:skycity    文件:Hud.java   
public Hud(SpriteBatch batch){
    viewport = new FillViewport(Config.SCREEN_WIDTH,Config.SCREEN_HEIGHT,new OrthographicCamera());
    stage = new Stage(viewport,batch);
    labelHP = new Label("HP: 100/100", Assets.getInstance().getSkin());
    labelVP = new Label("VP: 100/100",Assets.getInstance().getSkin());

    table = new Table();
    table.setFillParent(true);
    table.top().right().padTop(20).padRight(20).setDebug(false);
    table.add(labelHP);
    table.row();
    table.add(labelVP);
    stage.addActor(table);
}
项目:fluffybalance    文件:IngameGuiEntity.java   
public void create() {
    Stage stage = new Stage(new ScreenViewport());
    getComponentByType(GuiComponent.class).stage = stage;

    Table gameScore = new Table();

    float scorePanelWidth = Gdx.graphics.getWidth() * 0.8f; // 80 % of screen
    float scorePanelHeight = Gdx.graphics.getHeight() * 0.2f; // 20 % of screen

    gameScore.setWidth(scorePanelWidth);
    gameScore.setHeight(scorePanelHeight);
    gameScore.setY(Gdx.graphics.getHeight() - (scorePanelHeight + 30.f));
    gameScore.setX((Gdx.graphics.getWidth() - scorePanelWidth) * 0.5f);

    gameScore.setBackground(new NinePatchDrawable(
            new NinePatch(new Texture(Gdx.files.internal("red_button13.png")), 24, 24, 24, 24)));
    gameScore.pad(32.f);

    Label scoreLabel = new Label("Score", new Label.LabelStyle(
            mFont, COLOR_FONT));
    scoreLabel.setFontScale(1.2f);

    gameScore.add(scoreLabel).expand();

    gameScore.row();

    mScoreLabel = new Label("" + 0, new Label.LabelStyle(mFont, COLOR_FONT));
    mScoreLabel.setFontScale(2.0f);

    gameScore.add(mScoreLabel).expand();

    stage.addActor(gameScore);
}
项目:blueirisviewer    文件:WindowOptionsWnd.java   
@Override
protected void onUpdate(final Window window, final Table table)
{
    IntRectangle currentPosition = BlueIrisViewer.windowHelper.GetWindowRectangle();
    if (currentPosition.x != previousPosition.x)
        txtWindowX.setText(String.valueOf(currentPosition.x));
    if (currentPosition.y != previousPosition.y)
        txtWindowY.setText(String.valueOf(currentPosition.y));
    if (currentPosition.width != previousPosition.width)
        txtWindowW.setText(String.valueOf(currentPosition.width));
    if (currentPosition.height != previousPosition.height)
        txtWindowH.setText(String.valueOf(currentPosition.height));
    previousPosition = currentPosition;
}
项目:projecttd    文件:CreditsScreen.java   
@Override
public void show() {
    stage = new Stage();
    Gdx.input.setInputProcessor(stage);

    VisUI.load();

    CenteredTableBuilder tableBuilder = new CenteredTableBuilder(new Padding(2, 3));

    VisLabel heading = new VisLabel("Credits");
    heading.setColor(Color.BLACK);
    tableBuilder.append(heading).row();
    stage.addActor(heading);

    VisLabel temp = new VisLabel("To Be Implemented");
    temp.setColor(Color.BLACK);
    tableBuilder.append(temp).row();
    stage.addActor(temp);

    VisTextButton backButton = new VisTextButton("Back");
    backButton.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            ((Game) Gdx.app.getApplicationListener()).setScreen(new MainMenuScreen());
        }
    });
    tableBuilder.append(backButton).row();
    stage.addActor(backButton);

    Table table = tableBuilder.build();
    table.setFillParent(true);
    stage.addActor(table);
}
项目:projecttd    文件:OptionsScreen.java   
@Override
public void show() {
    stage = new Stage();
    Gdx.input.setInputProcessor(stage);

    VisUI.load();

    CenteredTableBuilder tableBuilder = new CenteredTableBuilder(new Padding(2, 3));

    VisLabel heading = new VisLabel("Options");
    heading.setColor(Color.BLACK);
    tableBuilder.append(heading).row();
    stage.addActor(heading);

    VisLabel temp = new VisLabel("To Be Implemented");
    temp.setColor(Color.BLACK);
    tableBuilder.append(temp).row();
    stage.addActor(temp);

    VisTextButton backButton = new VisTextButton("Back");
    backButton.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            ((Game) Gdx.app.getApplicationListener()).setScreen(new MainMenuScreen());
        }
    });
    tableBuilder.append(backButton).row();
    stage.addActor(backButton);

    Table table = tableBuilder.build();
    table.setFillParent(true);
    stage.addActor(table);
}
项目:Tower-Defense-Galaxy    文件:DebugScreen.java   
@Override
public void show() {
    super.show();

    background = new Texture("theme/basic/ui/Window.png");

    final TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
    textButtonStyle.font = game.getFonts().get("moonhouse64");
    textButtonStyle.up = new TextureRegionDrawable(new TextureRegion(background));

    Table table = new Table();
    table.setSize(viewport.getWorldWidth(), viewport.getWorldHeight());

    //Unlock achievement button
    TextButton achievementButton = new TextButton("Unlock Achievement", textButtonStyle);
    achievementButton.addListener(new ChangeListener() {
        @Override
        public void changed(ChangeEvent event, Actor actor) {
            if(TDGalaxy.onlineServices != null)
                TDGalaxy.onlineServices.unlockAchievement(Constants.ACHIEVEMENT_NO_LIFE);
        }
    });
    table.add(achievementButton);

    table.center();
    stage.addActor(table);
}