/** * Updates the actor based on time. Typically this is called each frame by {@link * Stage#act(float)}. * * <p>The default implementation calls {@link Action#act(float)} on each action and removes * actions that are complete. * * @param delta Time in seconds since the last frame. */ public void act(float delta) { for (int i = 0, n = actions.size; i < n; i++) { Action action = actions.get(i); if (action.act(delta)) { actions.removeIndex(i); action.setActor(null); i--; n--; } } }
public void removeAction(Action action) { if (actions.removeValue(action, true)) action.setActor(null); }
public void addAction(Action action) { action.setActor(this); actions.add(action); }