#19 滚动精灵支持

This commit is contained in:
yhh
2020-08-07 11:02:04 +08:00
parent 359d7ae223
commit 1bf822725a
9 changed files with 109 additions and 38 deletions

View File

@@ -89,7 +89,7 @@ module es {
this._sourceRect.height = value;
}
protected _sourceRect: Rectangle = new Rectangle();
protected _sourceRect: Rectangle;
protected _textureScale = Vector2.one;
protected _inverseTexScale = Vector2.one;
@@ -97,17 +97,17 @@ module es {
super(sprite);
this._sourceRect = sprite.sourceRect;
let bitmap = this.displayObject as Bitmap;
bitmap.$fillMode = egret.BitmapFillMode.REPEAT;
}
public render(camera: es.Camera) {
super.render(camera);
let bitmap = this.displayObject as Bitmap;
bitmap.width = this.width;
bitmap.height = this.height;
super.render(camera);
bitmap.scrollRect = this._sourceRect;
}
}
}