/**
*
*/
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);
}
}
}