示例#1
0
  public void render(float delta) {

    Gdx.gl.glClearColor(0, 0, 0, 1);
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

    stage.act(delta);
    stage.draw();

    tweenManager.update(delta);
  }
示例#2
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)));
  }
示例#3
0
  public void resize(int width, int height) {

    stage.setViewport(width, height, true);
    table.invalidateHierarchy();
    table.setSize(width, height);
  }
示例#4
0
  public void dispose() {

    stage.dispose();
    atlas.dispose();
    skin.dispose();
  }