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

x33g5p2x  于2022-01-21 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(141)

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

Image.addAction介绍

暂无

代码示例

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

@Override
public void create () {
  stage = new Stage();
  texture = new Texture(Gdx.files.internal("data/badlogic.jpg"), false);
  texture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
  final Image img = new Image(new TextureRegion(texture));
  img.setSize(100, 100);
  img.setOrigin(50, 50);
  img.setPosition(100, 100);
  // img.addAction(forever(sequence(delay(1.0f), new Action() {
  // public boolean act (float delta) {
  // System.out.println(1);
  // img.clearActions();
  // return true;
  // }
  // })));
  img.addAction(Actions.moveBy(100, 0, 2));
  img.addAction(Actions.after(Actions.scaleTo(2, 2, 2)));
  stage.addActor(img);
}

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

@Override
public void create () {
  stage = new Stage();
  texture = new Texture(Gdx.files.internal("data/badlogic.jpg"), false);
  texture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
  img = new Image(new TextureRegion(texture));
  img.setSize(100, 100);
  img.setOrigin(50, 50);
  img.setPosition(100, 100);
  img2 = new Image(new TextureRegion(texture));
  img2.setSize(100, 100);
  img2.setOrigin(50, 50);
  img2.setPosition(100, 100);
  img3 = new Image(new TextureRegion(texture));
  img3.setSize(100, 100);
  img3.setOrigin(50, 50);
  img3.setPosition(100, 100);
  stage.addActor(img);
  stage.addActor(img2);
  stage.addActor(img3);
  img.addAction(sequence());
  img2.addAction(parallel(sequence(), moveBy(100, 0, 1)));
  img3.addAction(sequence(parallel(moveBy(100, 200, 2)), Actions.run(this)));
}

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

@Override
public void create () {
  stage = new Stage();
  Action complexAction = forever(sequence(parallel(rotateBy(180, 2), scaleTo(1.4f, 1.4f, 2), alpha(0.7f, 2)),
    parallel(rotateBy(180, 2), scaleTo(1.0f, 1.0f, 2), alpha(1.0f, 2))));
  texture = new Texture(Gdx.files.internal("data/badlogic.jpg"), false);
  texture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
  final Image img1 = new Image(new TextureRegion(texture));
  img1.setSize(100, 100);
  img1.setOrigin(50, 50);
  img1.setPosition(50, 50);
  final Image img2 = new Image(new TextureRegion(texture));
  img2.setSize(50, 50);
  img2.setOrigin(50, 50);
  img2.setPosition(150, 150);
  stage.addActor(img1);
  stage.addActor(img2);
  img1.addAction(complexAction);
  // img2.action(complexAction.copy());
}

代码示例来源:origin: stackoverflow.com

Image myImage = new Image(myTexture);
myImage.addAction(Actions.parallel(Actions.moveTo(endX, endY, duration), Actions.rotateBy(degrees, duration)));
myImage.setPosition(startX, startY);
myImage.setOrigin(sizeX/2, sizeY/2);
stage.add(myImage);

代码示例来源:origin: Var3D/var3dframe

public void touchUp(InputEvent event, float px, float py, int pointer, int but) {
    if(isMoveing==true) {
      isMoveing = false;
      //加个缓停效果
      img_tank.clearActions();
      img_tank.addAction(Actions.moveBy(speedX * 10, speedY * 10, 0.6f, Interpolation.pow2Out));
    }
  }
});

代码示例来源:origin: Var3D/var3dframe

public void addBackgroundAcition() {
  bg0.clearActions();
  bg0.addAction(Actions.sequence(Actions.alpha(0),
      Actions.alpha(endAlpha, 0.5f)));
}

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

public void animateHighlight() {
  if (highlightAction != null) {
    imgHighlight.removeAction(highlightAction);
    highlightAction = null;
  }
  imgHighlight.addAction(highlightAction = Actions.sequence(
      Actions.alpha(1f),
      Actions.visible(true),
      Actions.fadeOut(5f, Interpolation.pow3Out),
      Actions.visible(false)
  ));
}

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

moveToAction.setDuration(0.2f);
indicator0.clearActions();
indicator0.addAction(moveToAction);
indicator1.setPosition(indicatorX, newIndicatorY);
moveToAction.setDuration(0.2f);
indicator0.clearActions();
indicator0.addAction(moveToAction);
indicator1.setPosition(indicatorX, newIndicatorY);

代码示例来源:origin: kbz/SIFTrain

splashImage.addAction(Actions.sequence(Actions.alpha(0)
    , Actions.fadeIn(0.75f), Actions.delay(1.5f), Actions.run(new Runnable() {
  @Override

代码示例来源:origin: Var3D/var3dframe

test.addAction(Actions.forever(Actions.rotateBy(3)));

相关文章