mirror of
https://github.com/wassname/phaser.git
synced 2026-08-13 12:30:11 +08:00
Added in frameName support for animations and easy setting of sprites born from a texture atlas (all for you Jesse!)
This commit is contained in:
+9
-1
@@ -104,6 +104,14 @@ class Sprite extends GameObject {
|
||||
return this.animations.frame;
|
||||
}
|
||||
|
||||
public set frameName(value?: string) {
|
||||
this.animations.frameName = value;
|
||||
}
|
||||
|
||||
public get frameName(): string {
|
||||
return this.animations.frameName;
|
||||
}
|
||||
|
||||
public render(camera:Camera, cameraOffsetX: number, cameraOffsetY: number): bool {
|
||||
|
||||
// Render checks
|
||||
@@ -135,7 +143,7 @@ class Sprite extends GameObject {
|
||||
this._dw = this.bounds.width * this.scale.x;
|
||||
this._dh = this.bounds.height * this.scale.y;
|
||||
|
||||
if (this.animations.currentFrame)
|
||||
if (this.animations.currentFrame !== null)
|
||||
{
|
||||
this._sx = this.animations.currentFrame.x;
|
||||
this._sy = this.animations.currentFrame.y;
|
||||
|
||||
Reference in New Issue
Block a user