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; }
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; }
@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); }
@Override public boolean act(float timeDelta) { boolean rueckgabe = true; rueckgabe &= moveToAction.act(timeDelta); rueckgabe &= scaleToAction.act(timeDelta); return rueckgabe; }
@Override public void setActor(Actor actor) { super.setActor(actor); moveToAction.setActor(actor); scaleToAction.setActor(actor); }
public void setDuration(float duration) { moveToAction.setDuration(duration); scaleToAction.setDuration(duration); }
public void setPosition(float x, float y) { moveToAction.setPosition(x, y); }