if(SomeCondition){ MoveToAction moveCar = new MoveToAction(); moveCar.setPosition(anX,anY); moveCar.setDuration(aDuration); myCarActor.addAction(moveCar); }
MoveToAction action = new MoveToAction(); action.setY(10); // y-position to move to action.setDuration(duration); // time (in seconds) to move there actor.addAction(action);
MoveToAction moveAction = new MoveToAction(); moveAction.setPosition(300f, 0f); moveAction.setDuration(10f); myActor.addAction(moveAction);
public void actionMoveTo(float x, float y, float duration) { // Move to a specific position by time MoveToAction action = new MoveToAction(); action.setPosition(x, y); if (duration > 0) { action.setDuration(duration); } addAction(action); }
Button botonTest = new Button(new Skin(Gdx.files.internal("skin/uiskin.json"))); botonTest.setPosition(50f, 50f); MoveToAction move = new MoveToAction(); move.setPosition(-10f, 50f); move.setDuration(5f); botonTest.addAction(move);
Table actionTable = new Table(); //position the table outside the screen actionTable.setPosition(stage.getWidth(), 0); //Position on the right of the stage MoveToAction moveAction = new MoveToAction(); moveAction.setPosition(0, 0); //Move from right side of stage inside the stage moveAction.setDuration(.5f); //Duration of this action moveAction.setInterpolation(Interpolation.fade); //Fade the movement in and out, many interpolations are supplied by the framework. actionTable.addAction(moveAction); //Execute Action.
MoveToAction moveToAction = new MoveToAction(); moveToAction.setPosition(indicatorX, newIndicatorY); moveToAction.setDuration(0.2f); MoveToAction moveToAction = new MoveToAction(); moveToAction.setPosition(indicatorX, newIndicatorY); moveToAction.setDuration(0.2f);