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

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

Introduction

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

Prototype

public void restart() 

Source Link

Document

Sets the state of the action so it can be run again.

Usage

From source file:hku.fyp14017.blencode.content.Look.java

License:Open Source License

@Override
public void act(float delta) {
    Array<Action> actions = getActions();
    allActionsAreFinished = false;//  ww w  . j  av a 2  s . c  om
    int finishedCount = 0;

    for (Iterator<Action> iterator = Look.actionsToRestart.iterator(); iterator.hasNext();) {
        Action actionToRestart = iterator.next();
        actionToRestart.restart();
        iterator.remove();
    }

    for (int i = 0, n = actions.size; i < n; i++) {
        Action action = actions.get(i);
        if (action.act(delta)) {
            finishedCount++;
        }
    }
    if (finishedCount == actions.size) {
        allActionsAreFinished = true;
    }
}

From source file:org.catrobat.catroid.content.Look.java

License:Open Source License

@Override
public void act(float delta) {
    Array<Action> actions = getActions();
    allActionsAreFinished = false;/*  w  ww. j ava 2 s .c o m*/
    int finishedCount = 0;

    for (Iterator<Action> iterator = Look.actionsToRestart.iterator(); iterator.hasNext();) {
        Action actionToRestart = iterator.next();
        actionToRestart.restart();
        iterator.remove();
    }

    int n = actions.size;
    for (int i = 0; i < n; i++) {
        Action action = actions.get(i);
        if (action.act(delta)) {
            finishedCount++;
        }
    }
    if (finishedCount == actions.size) {
        allActionsAreFinished = true;
    }
}