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

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

Introduction

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

Prototype

abstract public boolean act(float delta);

Source Link

Document

Updates the action based on time.

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;// w w  w  .  j av  a  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();
    }

    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;//from  w  w  w  .ja  v  a 2s .c  om
    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;
    }
}