Exemplo n.º 1
0
 /**
  * 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);
   }
 }
Exemplo n.º 2
0
  final int update(Pattern pattern, int patternpos) {
    patternpos = updateData(pattern, patternpos);

    em.updateData(ud);
    im.updateData(ud);
    return patternpos;
  }
Exemplo n.º 3
0
 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);
             }
           }
         }
       }
     }
   }
 }
Exemplo n.º 4
0
 @Override
 public void setMainCanvas(Canvas mainCanvas) {
   this.mainCanvas = mainCanvas;
   this.effectManager = new EffectManager(mainCanvas);
   effectManager.getEffects().addAll(getEffects());
 }
Exemplo n.º 5
0
 @Override
 public void paint(Graphics g) {
   if (effectManager != null) {
     effectManager.paint(this, g);
   }
 }
Exemplo n.º 6
0
 public final void updateTick() {
   em.tick();
   im.tick();
 }