public void addAction (Action action) { actions.add(action); if (actor != null) action.setActor(actor); }
public void removeAction (Action action) { if (actions.removeValue(action, true)) action.setActor(null); }
public void addAction (Action action) { actions.add(action); if (actor != null) action.setActor(actor); }
public void removeAction (Action action) { if (actions.removeValue(action, true)) action.setActor(null); }
/** Removes all actions on this actor. */ public void clearActions () { for (int i = actions.size - 1; i >= 0; i--) actions.get(i).setActor(null); actions.clear(); }
/** Removes all actions on this actor. */ public void clearActions () { for (int i = actions.size - 1; i >= 0; i--) actions.get(i).setActor(null); actions.clear(); }
public void addAction (Action action) { action.setActor(this); actions.add(action); if (stage != null && stage.getActionsRequestRendering()) Gdx.graphics.requestRendering(); }
public void addAction (Action action) { action.setActor(this); actions.add(action); if (stage != null && stage.getActionsRequestRendering()) Gdx.graphics.requestRendering(); }
/** 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) { Array<Action> actions = this.actions; if (actions.size == 0) return; if (stage != null && stage.getActionsRequestRendering()) Gdx.graphics.requestRendering(); try { for (int i = 0; i < actions.size; i++) { Action action = actions.get(i); if (action.act(delta) && i < actions.size) { Action current = actions.get(i); int actionIndex = current == action ? i : actions.indexOf(action, true); if (actionIndex != -1) { actions.removeIndex(actionIndex); action.setActor(null); i--; } } } } catch (RuntimeException ex) { String context = toString(); throw new RuntimeException("Actor: " + context.substring(0, Math.min(context.length(), 128)), ex); } }
/** 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) { Array<Action> actions = this.actions; if (actions.size == 0) return; if (stage != null && stage.getActionsRequestRendering()) Gdx.graphics.requestRendering(); try { for (int i = 0; i < actions.size; i++) { Action action = actions.get(i); if (action.act(delta) && i < actions.size) { Action current = actions.get(i); int actionIndex = current == action ? i : actions.indexOf(action, true); if (actionIndex != -1) { actions.removeIndex(actionIndex); action.setActor(null); i--; } } } } catch (RuntimeException ex) { String context = toString(); throw new RuntimeException("Actor: " + context.substring(0, Math.min(context.length(), 128)), ex); } }
public void addAction (Action action) { actions.add(action); if (actor != null) action.setActor(actor); }
public void removeAction (Action action) { if (actions.removeValue(action, true)) action.setActor(null); }
/** Removes all actions on this actor. */ public void clearActions () { for (int i = actions.size - 1; i >= 0; i--) actions.get(i).setActor(null); actions.clear(); }
public void addAction (Action action) { action.setActor(this); actions.add(action); if (stage != null && stage.getActionsRequestRendering()) Gdx.graphics.requestRendering(); }