Пример #1
0
  public void show() {

    stage = new Stage();

    Gdx.input.setInputProcessor(stage);

    atlas = new TextureAtlas("ui/atlas.pack");
    skin = new Skin(Gdx.files.internal("ui/menuSkin.json"), atlas);

    Texture chipBg = new Texture(Gdx.files.internal("img/chips.png"));
    stage.addActor(new Image(chipBg));

    table = new Table(skin);
    table.setBounds(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    table.bottom().right();

    backButton = new TextButton("BACK", skin);
    backButton.addListener(
        new ClickListener() {
          public void clicked(InputEvent event, float x, float y) {
            ((Game) Gdx.app.getApplicationListener()).setScreen(new PotatoMenu());
          }
        });
    backButton.pad(10);

    table.add(backButton).bottom().right();
    ;

    stage.addActor(table);

    tweenManager = new TweenManager();
    Tween.registerAccessor(Actor.class, new ActorAccessor());

    tweenManager.update(Gdx.graphics.getDeltaTime());

    stage.addAction(sequence(moveTo(0, stage.getHeight()), moveTo(0, 0, .5f)));
  }
Пример #2
0
 /**
  * Adds the given button to the button table.
  *
  * @param object The object that will be passed to {@link #result(Object)} if this button is
  *     clicked. May be null.
  */
 public Dialog button(Button button, Object object) {
   buttonTable.add(button);
   setObject(button, object);
   return this;
 }
Пример #3
0
 /** Adds the given Label to the content table */
 public Dialog text(Label label) {
   contentTable.add(label);
   return this;
 }