Package de.nameless.graphicEngine.lib

Source Code of de.nameless.graphicEngine.lib.NESpriteMovie

/**
*
*/
package de.nameless.graphicEngine.lib;

import javax.swing.text.html.HTMLDocument.HTMLReader.IsindexAction;

import de.nameless.graphicEngine.animation.NESpriteFrame;
import de.nameless.graphicEngine.animation.NEabstractAnimation;
import de.nameless.graphicEngine.animation.lib.NEASpriteAnimation;

/**
* @author Stefan Wittek
*
*/
public class NESpriteMovie extends NEQuad {
 
  private int repeats;
  private int startX;
  private int startY;
  private int length;
 
  public NESpriteMovie(String texturepath, int spriteH,int spriteW, float size, int repeats, int startX, int startY, int length) {
    this.repeats = repeats;
    this.setHeight(size);
    this.setWidth(size);
    this.length = length;
    this.startX = startX;
    this.startY = startY;
    this.setTexture(texturepath);   
    this.xAngel =90;
    this.enableSprites(spriteH, spriteW, startX, startY);   
  }
 
  public void start(){
    int spriteH = this.spriteHigh;
    int spriteW = this.spriteWidth;
   
    int re = repeats==0?-1:repeats;
   
    this.addAnimation(
        new NEASpriteAnimation(
          NESpriteFrame.ConstructMovie(new NESpriteFrame(startX,startY), length,1, spriteH, spriteW, 15, re
        )
    );
  }
 
  @Override
  public void notifyAnimationEnd(NEabstractAnimation a) {
   
    if (a instanceof NEASpriteAnimation) {     
        animations.remove(a);
        animationManager.removeNextFlush(a);       
        this.holdingManager.removeNextFlush(this);       
    }
  }
 
}
TOP

Related Classes of de.nameless.graphicEngine.lib.NESpriteMovie

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.