瀏覽代碼

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 loop : Bool = true;
 	
-	public function new( ?parent ) {
+	public function new( ?frames, ?speed, ?parent ) {
 		super(parent);
-		this.frames = [];
+		this.frames = frames == null ? [] : frames;
 		this.currentFrame = 0;
-		this.speed = 1.;
+		this.speed = speed == null ? 15 : speed;
 	}
 	
 	public function play( frames ) {