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

x33g5p2x  于2022-01-20 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(96)

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

Group.addAction介绍

暂无

代码示例

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

/** Adds an action to the root of the stage.
 * @see Group#addAction(Action) */
public void addAction (Action action) {
  root.addAction(action);
}

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

/** Adds an action to the root of the stage.
 * @see Group#addAction(Action) */
public void addAction (Action action) {
  root.addAction(action);
}

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

@Override
public void create () {
  texture = new Texture(Gdx.files.internal("data/badlogicsmall.jpg"));
  stage = new Stage();
  for (int i = 0; i < 100; i++) {
    Image img = new Image(new TextureRegion(texture));
    img.setX((float)Math.random() * 480);
    img.setY((float)Math.random() * 320);
    img.getColor().a = (float)Math.random() * 0.5f + 0.5f;
    stage.addActor(img);
  }
  stage.getRoot().addAction(forever(sequence(fadeOut(3), fadeIn(3))));
}

代码示例来源:origin: com.badlogicgames.gdx/gdx

/** Adds an action to the root of the stage.
 * @see Group#addAction(Action) */
public void addAction (Action action) {
  root.addAction(action);
}

代码示例来源:origin: dingjibang/GDX-RPG

public void start(String id) {
  idList.add(id);
  sprite.clearActions();
  sprite.addAction(Actions.fadeIn(.3f));
}

代码示例来源:origin: dingjibang/GDX-RPG

public void act() {
  //更新资源
  updated = Res.act();
  if(sprite.getActions().size == 0){
    if(updated && idList.isEmpty() && sprite.getColor().a == 1f)
      sprite.addAction(Actions.fadeOut(.3f));
    
    if((!updated || !idList.isEmpty()) && sprite.getColor().a == 0)
      sprite.addAction(Actions.fadeIn(.3f));
  }
  String currentFPS = Gdx.graphics.getFramesPerSecond() + "";
  boolean showFPS = Game.setting.showFPS;
  fps.text(showFPS ? currentFPS : "");
  fpsShadow.text(showFPS ? currentFPS : "");
}

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

@Override
public void onDragFinished() {
  eventDispatcher.postEvent(new FileDragDropEvent(FileDragDropEvent.Action.STOP_DRAGGING));
  overlayRoot.clearActions();
  overlayRoot.addAction(Actions.sequence(
      Actions.fadeOut(0.35f),
      Actions.visible(false)
  ));
}

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

@Override
public void onDragStarted(int screenX, int screenY) {
  eventDispatcher.postEvent(new FileDragDropEvent(FileDragDropEvent.Action.START_DRAGGING));
  overlayRoot.clearActions();
  overlayRoot.addAction(Actions.sequence(
      Actions.scaleTo(1.5f, 1.5f),
      Actions.visible(true),
      Actions.parallel(
          Actions.fadeIn(0.5f, Interpolation.pow5Out),
          Actions.scaleTo(1f, 1f, 0.5f, Interpolation.pow5Out)
      )
  ));
}

代码示例来源:origin: dingjibang/GDX-RPG

public void skip() {
  if(skiping)
    return;
  
  skiping = true;
  
  seManager.stop();
  
  Image mask = UI.base();
  
  mask.query().fillParent().color(Color.BLACK).fadeOut().action(Actions.sequence(Actions.fadeIn(.5f), Actions.run(() -> {
    //所有stages已经播放完毕
    if(currentStage + 1 == stages.size()){
      Views.addView(TitleView.class);
      remove();
      return;
    }
    
    skiping = false;
    
    group.clear();
    
    group.addAction(stages.get(++currentStage));
    mask.addAction(Actions.sequence(Actions.fadeOut(.5f), Actions.removeActor()));
    
  }))).to(stage);
  
}

代码示例来源:origin: dingjibang/GDX-RPG

group.addAction(Actions.delay(.7f, Actions.run(() -> {
  GdxQuery point = Res.sync(Path.IMAGE_LOGO + "p_1.png").query().to(group).zIndex(2).position(Game.STAGE_WIDTH / 2, Game.STAGE_HEIGHT / 2);
  )));
  seManager.play(Path.MUSIC_SE + "se_1.mp3");
  group.addAction(Actions.delay(1.5f, Actions.run(() -> {
    for(int i = 0; i < pointsCount; i ++){
      boolean left = MathUtils.randomBoolean(), top = MathUtils.randomBoolean();
  group.addAction(Actions.delay(2f, Actions.run(() -> {
    seManager.play(Path.MUSIC_SE + "logo.mp3");
  })));
  group.addAction(Actions.delay(4.8f, Actions.run(() -> point.action(Actions.scaleTo(1, 1, .3f, Interpolation.bounceOut)))));
  group.addAction(Actions.delay(5.4f, Actions.run(() -> {
    point.action(Actions.sequence(Actions.moveBy(-77, 0, .5f, Interpolation.pow2Out), Actions.delay(.7f), Actions.fadeOut(.3f)));
    group.addAction(Actions.delay(.7f, Actions.run(() -> {
      group.addAction(Actions.delay(1.6f, Actions.run(() -> {
        Res.sync(Path.IMAGE_LOGO + "bottom.png").query().nearest().fadeOut().position(Game.STAGE_WIDTH / 2, -100).center(true).action(Actions.fadeIn(.5f)).action(Actions.moveBy(0, 150, .5f, Interpolation.pow2Out)).to(group);
      })));
      group.addAction(Actions.delay(.3f, Actions.run(() -> {
        Res.sync(Path.IMAGE_LOGO + "circle.png").query().color("d9bc64").position(Game.STAGE_WIDTH / 2 - 77, Game.STAGE_HEIGHT / 2).center(true).scale(0).action(Actions.scaleTo(30, 30, .8f, Interpolation.pow4In)).to(group).zIndex(1);
        Res.sync(Path.IMAGE_LOGO + "circle.png").query().color("22ac38").position(Game.STAGE_WIDTH / 2 - 77, Game.STAGE_HEIGHT / 2).center(true).scale(0).action(Actions.delay(.4f, Actions.scaleTo(30, 30, .8f, Interpolation.pow4In))).to(group).zIndex(2);
Res.get(Path.IMAGE_LOGO + "bg2.png").query().size(Game.STAGE_WIDTH, Game.STAGE_HEIGHT).fadeOut().fadeIn(.5f).to(group);
Res.get(Path.IMAGE_LOGO + "hv.png").query().position(400, 50).fadeOut().action(Actions.delay(.5f, Actions.fadeIn(.5f))).to(group);

代码示例来源:origin: langurmonkey/gaiasky

engineLabelRotated.addActor(engineLabel);
float engineLabelH = enginePowerH - enginePlus.getHeight() - engineMinus.getHeight() - 2;
engineLabelRotated.addAction(Actions.rotateBy(-90));
engineLabelRotated.addAction(Actions.moveBy(-5, (((engineLabelH - enginePlus.getHeight()) - engineLabel.getWidth()) / 2f + engineLabel.getWidth())));
engineLabelRotated.setHeight(engineLabelH);

相关文章

微信公众号

最新文章

更多