Переглянути джерело

added frames and speed in constructor params for h2d.Anim

ncannasse 11 роки тому
батько
коміт
5e7957da44
1 змінених файлів з 3 додано та 3 видалено
  1. 3 3
      h2d/Anim.hx

+ 3 - 3
h2d/Anim.hx

@@ -7,11 +7,11 @@ class Anim extends Drawable {
 	public var speed : Float;
 	public var speed : Float;
 	public var loop : Bool = true;
 	public var loop : Bool = true;
 	
 	
-	public function new( ?parent ) {
+	public function new( ?frames, ?speed, ?parent ) {
 		super(parent);
 		super(parent);
-		this.frames = [];
+		this.frames = frames == null ? [] : frames;
 		this.currentFrame = 0;
 		this.currentFrame = 0;
-		this.speed = 1.;
+		this.speed = speed == null ? 15 : speed;
 	}
 	}
 	
 	
 	public function play( frames ) {
 	public function play( frames ) {