Example usage for com.badlogic.gdx.utils Align bottomRight

List of usage examples for com.badlogic.gdx.utils Align bottomRight

Introduction

In this page you can find the example usage for com.badlogic.gdx.utils Align bottomRight.

Prototype

int bottomRight

To view the source code for com.badlogic.gdx.utils Align bottomRight.

Click Source Link

Usage

From source file:com.agateau.ui.UiBuilder.java

License:Apache License

private static int parseAlign(XmlReader.Element element) {
    String alignText = element.getAttribute("align", "");
    if (alignText.isEmpty()) {
        return -1;
    }/*www.j a  v a 2  s . c  o  m*/
    if (alignText.equals("center")) {
        return Align.center;
    } else if (alignText.equals("centerLeft")) {
        return Align.left;
    } else if (alignText.equals("centerRight")) {
        return Align.right;
    } else if (alignText.equals("topLeft")) {
        return Align.topLeft;
    } else if (alignText.equals("topCenter")) {
        return Align.top;
    } else if (alignText.equals("topRight")) {
        return Align.topRight;
    } else if (alignText.equals("bottomLeft")) {
        return Align.bottomLeft;
    } else if (alignText.equals("bottomCenter")) {
        return Align.bottom;
    } else if (alignText.equals("bottomRight")) {
        return Align.bottomRight;
    } else {
        throw new RuntimeException("Unknown value of 'align': " + alignText);
    }
}

From source file:halive.shootinoutside.game.hud.GameHUD.java

public void init() {
    table = new Table();
    table.setSkin(skin);//from ww  w .  ja v a  2  s  .  co m

    table.setFillParent(true);
    //table.setDebug(true);

    Table weaponInfo = new Table(skin);
    weaponLabel = new Label("None", skin);
    HorizontalGroup weaponGroup = new HorizontalGroup();
    weaponGroup.addActor(new Label("Selected Weapon: ", skin));
    weaponGroup.addActor(weaponLabel);
    weaponGroup.align(Align.bottomLeft);

    HorizontalGroup ammoGroup = new HorizontalGroup();
    ammoGroup.align(Align.bottomRight);
    ammoGroup.addActor(new Label("Clips: ", skin));
    clipLabel = new Label("0", skin);
    ammoGroup.addActor(clipLabel);
    ammoGroup.addActor(new Label(" Ammo: ", skin));
    ammoLabel = new Label("0/100", skin);
    ammoGroup.addActor(ammoLabel);

    weaponInfo.add(weaponGroup).pad(1).row();
    weaponInfo.add(ammoGroup).pad(1).row();

    Table timeInfo = new Table(skin);
    HorizontalGroup timeGroup = new HorizontalGroup();
    timeGroup.align(Align.top);
    timeGroup.addActor(new Label("Time Left: ", skin));
    timeLabel = new Label("0:0", skin);
    timeGroup.addActor(timeLabel);
    timeInfo.add(timeGroup).pad(1).row();

    table.add(timeInfo).top().expand().row();
    table.add(weaponInfo).bottom().left().expand().row();

    this.addActor(table);
}