コード例 #1
0
 public void enable() {
   float x = this.getX();
   float y = _originalY;
   MoveToAction action = new MoveToAction();
   action.setPosition(x, y);
   action.setDuration(0.3f);
   this.addAction(action);
   enabled = true;
 }
コード例 #2
0
 public void disable() {
   float x = this.getX();
   float y = -50f;
   MoveToAction action = new MoveToAction();
   action.setPosition(x, y);
   action.setDuration(0.3f);
   this.addAction(action);
   enabled = false;
 }
コード例 #3
0
  @Override
  public void create() {
    stage = new Stage();
    Gdx.input.setInputProcessor(stage);

    MyActor myActor = new MyActor();

    MoveToAction action = Actions.action(MoveToAction.class);
    action.setPosition(100, 0);
    action.setDuration(2f);
    action.setInterpolation(Interpolation.linear);
    myActor.addAction(action);
    stage.addActor(myActor);
  }
コード例 #4
0
  @Override
  public boolean act(float timeDelta) {
    boolean rueckgabe = true;

    rueckgabe &= moveToAction.act(timeDelta);
    rueckgabe &= scaleToAction.act(timeDelta);

    return rueckgabe;
  }
コード例 #5
0
 @Override
 public void setActor(Actor actor) {
   super.setActor(actor);
   moveToAction.setActor(actor);
   scaleToAction.setActor(actor);
 }
コード例 #6
0
 public void setDuration(float duration) {
   moveToAction.setDuration(duration);
   scaleToAction.setDuration(duration);
 }
コード例 #7
0
 public void setPosition(float x, float y) {
   moveToAction.setPosition(x, y);
 }