Example usage for com.badlogic.gdx.scenes.scene2d.actions MoveByAction setAmount

List of usage examples for com.badlogic.gdx.scenes.scene2d.actions MoveByAction setAmount

Introduction

In this page you can find the example usage for com.badlogic.gdx.scenes.scene2d.actions MoveByAction setAmount.

Prototype

public void setAmount(float x, float y) 

Source Link

Usage

From source file:com.bagon.matchteam.mtx.scene2d.AbstractActorLight.java

License:Apache License

public void actionMoveBy(float x, float y, float duration) {
    // Move towards a direction during given time (NON-STOP)
    MoveByAction action = new MoveByAction();
    action.setAmount(x, y);
    if (duration > 0) {
        action.setDuration(duration);//w w  w  .  j a  v  a  2s  .  c o  m
    }
    addAction(action);
}

From source file:com.mk.apps.superm.mtx.AbstractActor.java

License:Apache License

public void actionMoveBy(float x, float y, float duration) {
    // Move towards a direction during given time (NON-STOP)
    MoveByAction action = new MoveByAction();
    action.setAmount(x, y);
    if (duration > 0.0f) {
        action.setDuration(duration);/*from  www.j  av  a  2  s  .  c o m*/
    }
    addAction(action);
}

From source file:com.sawan.mathattack.scene2d.AbstractActorLight.java

License:Open Source License

/**
 * Action move by.//w ww  .j  a  v  a  2 s  . co m
 *
 * @param x the x
 * @param y the y
 * @param duration the duration
 */
public void actionMoveBy(float x, float y, float duration) {
    // Move towards a direction during given time (NON-STOP)
    MoveByAction action = new MoveByAction();
    action.setAmount(x, y);
    if (duration > 0) {
        action.setDuration(duration);
    }
    addAction(action);
}

From source file:sink.map.MapActor.java

License:Apache License

public void moveBy(float x, float y, float duration) {
    // Move towards a direction during given time (NON-STOP)
    MoveByAction move = new MoveByAction();
    move.setAmount(x, y);
    if (duration > 0.0f) {
        move.setDuration(duration);/*  w w  w.  jav a 2s .  c o  m*/
    }
    Action over = new Action() {
        @Override
        public boolean act(final float it) {
            setPosition(this.getActor().getX(), this.getActor().getY());
            fireMovedEvent();
            return true;
        }
    };
    addAction(Actions.sequence(move, over));
}