Java Code Examples for com.badlogic.gdx.scenes.scene2d.ui.Table#align()

The following examples show how to use com.badlogic.gdx.scenes.scene2d.ui.Table#align() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ArrowMessageNet.java    From dice-heroes with GNU General Public License v3.0 6 votes vote down vote up
@Override protected Table getMessageTable() {

        LocLabel label = new LocLabel(locKey);
        label.setWrap(true);
        label.setAlignment(Align.center);

        Label tapToContinue = new LocLabel("tap-to-continue", ShowTutorialMessage.Message.TAP_TO_CONTINUE);
        tapToContinue.setWrap(true);
        tapToContinue.setAlignment(Align.center);

        Table result = new Table();
        result.align(Align.top);
        result.add(label).width(stage.getWidth() / 1.5f).row();
        result.add(new Image(Config.skin, "ui-creature-info-line")).width(120).padTop(4).row();
        result.add(tapToContinue);
        return result;
    }
 
Example 2
Source File: QuestsPanel.java    From riiablo with Apache License 2.0 6 votes vote down vote up
Tab() {
  questIcons = new Table();
  for (int i = 0; i < QUEST_COLS; i++) {
    questIcons.columnDefaults(i).size(80, 95).space(4, 16, 4, 16);
  }
  questIcons.align(Align.top | Align.center);
  add(questIcons).height(197).growX().row();

  questName = new Label(Riiablo.fonts.font16);
  questName.setAlignment(Align.center);
  add(questName).height(24).growX().row();

  questDialog = new DialogScroller(new DialogScroller.DialogCompletionListener() {
    @Override
    public void onCompleted(DialogScroller d) {
      questDialog.setTextId(selected.quest.qsts[0]);
    }
  });
  add(questDialog).grow().row();
}
 
Example 3
Source File: ArrowForceClickDiePane.java    From dice-heroes with GNU General Public License v3.0 5 votes vote down vote up
@Override protected Table getMessageTable() {
    Table result = new Table();
    result.align(Align.top);
    LocLabel label = new LocLabel(locKey);
    label.setWrap(true);
    label.setAlignment(Align.center);
    result.add(label).width(stage.getWidth() / 1.5f);
    return result;
}
 
Example 4
Source File: ArrowForceClickInventory.java    From dice-heroes with GNU General Public License v3.0 5 votes vote down vote up
@Override protected Table getMessageTable() {
    Table table = new Table(Config.skin);
    table.align(Align.top);
    Label label = new LocLabel("tutorial-open-dice-window");
    label.setWrap(true);
    label.setAlignment(Align.center);
    table.add(label);
    return table;
}
 
Example 5
Source File: ArrowForceClickStoreIcon.java    From dice-heroes with GNU General Public License v3.0 5 votes vote down vote up
@Override protected Table getMessageTable() {
    Table result = new Table();
    result.align(Align.bottom);
    LocLabel label = new LocLabel(locKey);
    label.setWrap(true);
    label.setAlignment(Align.center);
    result.add(label).width(stage.getWidth() / 1.5f);
    return result;
}
 
Example 6
Source File: ArrowForceClickStoreTab.java    From dice-heroes with GNU General Public License v3.0 5 votes vote down vote up
@Override protected Table getMessageTable() {
    Table result = new Table();
    result.align(Align.bottom);
    LocLabel label = new LocLabel(locKey);
    label.setWrap(true);
    label.setAlignment(Align.center);
    result.add(label).width(stage.getWidth() / 1.5f);
    return result;
}
 
Example 7
Source File: ExampleMain.java    From gdx-smart-font with MIT License 5 votes vote down vote up
@Override
public void create() {
	Gdx.app.setLogLevel(Application.LOG_DEBUG);
	SmartFontGenerator fontGen = new SmartFontGenerator();
	FileHandle exoFile = Gdx.files.local("LiberationMono-Regular.ttf");
	BitmapFont fontSmall = fontGen.createFont(exoFile, "exo-small", 24);
	BitmapFont fontMedium = fontGen.createFont(exoFile, "exo-medium", 48);
	BitmapFont fontLarge = fontGen.createFont(exoFile, "exo-large", 64);

	stage = new Stage();

	Label.LabelStyle smallStyle = new Label.LabelStyle();
	smallStyle.font = fontSmall;
	Label.LabelStyle mediumStyle = new Label.LabelStyle();
	mediumStyle.font = fontMedium;
	Label.LabelStyle largeStyle = new Label.LabelStyle();
	largeStyle.font = fontLarge;

	Label small = new Label("Small Font", smallStyle);
	Label medium = new Label("Medium Font", mediumStyle);
	Label large = new Label("Large Font", largeStyle);

	Table table = new Table();
	table.setFillParent(true);
	table.align(Align.center);
	stage.addActor(table);

	table.defaults().size(Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() / 6);

	table.add(small).row();
	table.add(medium).row();
	table.add(large).row();
}
 
Example 8
Source File: MainMenuInterface.java    From buffer_bci with GNU General Public License v3.0 4 votes vote down vote up
private void createTable() {
	table = new Table();
	table.setFillParent(true);
	table.align(Align.left);
	stage.addActor(table);
}