mirror of
https://github.com/wassname/phaser.git
synced 2026-09-09 11:28:47 +08:00
Adding in missing tests and fixing as we go
This commit is contained in:
@@ -143,7 +143,7 @@ module Phaser.Components {
|
||||
* @param clearAnimations {boolean} If this Sprite has a set of animation data already loaded you can choose to keep or clear it with this boolean
|
||||
* @return {Sprite} Sprite instance itself.
|
||||
*/
|
||||
public loadImage(key: string, clearAnimations: bool = true) {
|
||||
public loadImage(key: string, clearAnimations?: bool = true, updateBody?: bool = true) {
|
||||
|
||||
if (clearAnimations && this._sprite.animations.frameData !== null)
|
||||
{
|
||||
@@ -163,6 +163,12 @@ module Phaser.Components {
|
||||
this._sprite.frameBounds.width = this.width;
|
||||
this._sprite.frameBounds.height = this.height;
|
||||
}
|
||||
|
||||
if (updateBody)
|
||||
{
|
||||
this._sprite.body.bounds.width = this.width;
|
||||
this._sprite.body.bounds.height = this.height;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user