Example usage for com.badlogic.gdx.scenes.scene2d Action reset

List of usage examples for com.badlogic.gdx.scenes.scene2d Action reset

Introduction

In this page you can find the example usage for com.badlogic.gdx.scenes.scene2d Action reset.

Prototype

public void reset() 

Source Link

Document

Resets the optional state of this action to as if it were newly created, allowing the action to be pooled and reused.

Usage

From source file:org.catrobat.catroid.content.actions.StopAllScriptsAction.java

License:Open Source License

@Override
protected void update(float percent) {
    Array<Actor> stageActors = StageActivity.stageListener.getStage().getActors();
    for (Actor actor : stageActors) {
        for (Action action : actor.getActions()) {
            action.reset();
        }//from   w w  w  .  j av a2s .  c  o m
    }
}

From source file:org.catrobat.catroid.content.actions.StopOtherScriptsAction.java

License:Open Source License

@Override
protected void update(float percent) {
    if (this.actor == null || this.actor.getActions() == null) {
        return;/*from   w w  w .j  av a2  s.co  m*/
    }

    boolean alreadyStopped = false;
    String currentActionSignature = this.currentAction.toString();

    for (Action action : this.actor.getActions()) {
        if (!alreadyStopped && action.toString().contains(currentActionSignature)) {
            alreadyStopped = true;
            continue;
        } else {
            action.reset();
        }
    }
}