예제 #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);
   }
 }
예제 #2
0
  final int update(Pattern pattern, int patternpos) {
    patternpos = updateData(pattern, patternpos);

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