/** * Defines the effects of this panel. * * @param effects the effects to set */ public void setEffects(ArrayList<Effect> effects) { this.effects = effects; if (effectManager != null) { effectManager.getEffects().removeAll(effectManager.getEffects()); effectManager.getEffects().addAll(effects); } }
final int update(Pattern pattern, int patternpos) { patternpos = updateData(pattern, patternpos); em.updateData(ud); im.updateData(ud); return patternpos; }
public void update(float tpf) { if (isActive) { if (!effectSet) { currentEffectItem = queue.remove(0); targetTime = currentEffectItem.getDelay(); updateTime = 0; effectSet = true; effectStarted = false; } else { if (!effectStarted) { if (updateTime < targetTime) { updateTime += tpf / targetTime; } else { if (currentEffectItem.getEffect() != null) { // currentEffectItem.getEffect().getElement().getScreen().updateZOrder(currentEffectItem.getEffect().getElement()); effectManager.applyEffect(currentEffectItem.getEffect()); } else { // currentEffectItem.getBatchEffect().getScreen().updateZOrder(currentEffectItem.getEffect().getElement()); effectManager.applyBatchEffect(currentEffectItem.getBatchEffect()); } effectStarted = true; } } else { if (currentEffectItem.getEffect() != null) { if (!currentEffectItem.getEffect().getIsActive()) { effectSet = false; effectStarted = false; if (queue.isEmpty()) { isActive = false; // effectManager.removeEffectQueue(this); } } } else { if (!currentEffectItem.getBatchEffect().getIsActive()) { effectSet = false; effectStarted = false; if (queue.isEmpty()) { isActive = false; // effectManager.removeEffectQueue(this); } } } } } } }
@Override public void setMainCanvas(Canvas mainCanvas) { this.mainCanvas = mainCanvas; this.effectManager = new EffectManager(mainCanvas); effectManager.getEffects().addAll(getEffects()); }
@Override public void paint(Graphics g) { if (effectManager != null) { effectManager.paint(this, g); } }
public final void updateTick() { em.tick(); im.tick(); }