com.badlogic.gdx.scenes.scene2d.Stage.addAction()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(124)

本文整理了Java中com.badlogic.gdx.scenes.scene2d.Stage.addAction()方法的一些代码示例,展示了Stage.addAction()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Stage.addAction()方法的具体详情如下:
包路径:com.badlogic.gdx.scenes.scene2d.Stage
类名称:Stage
方法名:addAction

Stage.addAction介绍

[英]Adds an action to the root of the stage.
[中]将动作添加到舞台的根部。

代码示例

代码示例来源:origin: libgdx/libgdx

public void changed (ChangeEvent event, Actor actor) {
    stage.addAction(Actions.sequence(Actions.delay(2), Actions.run(new Runnable(){
      public void run () {
        nextColor();
        Gdx.app.log(str4, "RunnableAction executed");
      }
    })));
  }});
root.add(button4).row();

代码示例来源:origin: libgdx/libgdx

private void addEmitter(	float[] colors, Texture particleTexture, 
                          Vector3 translation, 
                          Vector3 actionAxis, float actionRotation){
  ParticleController controller = createBillboardController(colors, particleTexture);
  controller.init();
  controller.start();
  emitters.add(controller);
  controller.translate(translation);
  ui.addAction(new RotationAction(controller, actionAxis, actionRotation));
}

代码示例来源:origin: peakgames/libgdx-stagebuilder

@Override
public void show() {
  preShow();
  Gdx.input.setInputProcessor(this.stage);
  Gdx.app.log(TAG, "show");
  if (isFadeInEnabled()) {
    stage.getRoot().getColor().a = 0;
    stage.addAction(Actions.fadeIn(fadeInDuration));
  }
  layoutFileChecksum = calculateLayoutFileChecksum();
  postShow();
}

代码示例来源:origin: moribitotech/MTX

@Override
  public boolean act(float delta) {
    if (actionNext != null) {
      setScreen(nextScreen);
      nextScreen.getStage().addAction(actionNext);
      nextScreen.getStage().getRoot()
          .setTouchable(Touchable.enabled);
      isDisposeScreen = disposeScreen;
    } else {
      setScreen(nextScreen);
      nextScreen.getStage().getRoot()
          .setTouchable(Touchable.enabled);
      isDisposeScreen = disposeScreen;
    }
    return true;
  }
}));

代码示例来源:origin: yichen0831/Bomberman_libGdx

private void handleChangeScreen() {
  if (GameManager.levelCompleted && !changeScreen) {
    GameManager.getInstance().playSound("Teleport.ogg");
    stage.addAction(Actions.addAction(
        Actions.sequence(
            Actions.delay(1f),
    stage.addAction(Actions.addAction(
        Actions.sequence(
            Actions.delay(1f),

代码示例来源:origin: crashinvaders/gdx-texture-packer-gui

@LmlAfter void initView() {
  timerAction = new TimerAction(NOTIFICATION_CUTOFF, new Timer.Listener() {
    @Override
    public void onTimeUp() {
      updateProjectProperty();
    }
  });
  stage.addAction(timerAction);
  originalColor.set(modelService.getProject().getPreviewBackgroundColor());
  selectedColor.set(originalColor);
  colorPicker.setColor(selectedColor);
  // Close dialog on ESC
  dialog.addListener(new InputListener() {
    @Override
    public boolean keyDown (InputEvent event, int keycode) {
      if (keycode == Input.Keys.ESCAPE) {
        onCancelClick();
        return true;
      }
      return false;
    }
  });
  VisImageButton btnClose = WidgetUtils.obtainCloseButton(dialog);
  btnClose.addListener(new ChangeListener() {
    @Override
    public void changed(ChangeEvent event, Actor actor) {
      onCancelClick();
    }
  });
}

代码示例来源:origin: moribitotech/MTX

currentScreen.getStage().addAction(
    Actions.sequence(actionCurrent, new Action() {
      @Override
  setScreen(nextScreen);
  nextScreen.getStage().getRoot().setTouchable(Touchable.enabled);
  nextScreen.getStage().addAction(actionNext);
  isDisposeScreen = disposeScreen;
} else {

代码示例来源:origin: yichen0831/Bomberman_libGdx

@Override
public void show() {
  viewport = new FitViewport(640, 480);
  stage = new Stage(viewport, batch);
  font = new BitmapFont(Gdx.files.internal("fonts/foo.fnt"));
  Label.LabelStyle labelStyle = new Label.LabelStyle(font, Color.WHITE);
  Label gameOverLabel = new Label("Game Over", labelStyle);
  gameOverLabel.setPosition((640 - gameOverLabel.getWidth()) / 2, 226f);
  GameManager.getInstance().playMusic("GameOver.ogg", false);
  stage.addActor(gameOverLabel);
  stage.addAction(Actions.sequence(
      Actions.delay(1f),
      Actions.fadeOut(2f),
      Actions.run(new Runnable() {
        @Override
        public void run() {
          game.setScreen(new MainMenuScreen(game));
        }
      })));
}

代码示例来源:origin: yichen0831/Bomberman_libGdx

stage.addAction(new SequenceAction(Actions.delay(0.2f), Actions.fadeOut(1f), runnableAction));

代码示例来源:origin: yichen0831/Bomberman_libGdx

Image image = new Image(fadeOutTexture);
stage.addActor(image);
stage.addAction(Actions.fadeOut(0.5f));

代码示例来源:origin: yichen0831/Bomberman_libGdx

stage.addActor(princessAnimImage);
stage.addAction(
    Actions.sequence(
        Actions.delay(5f),

相关文章