mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 07:04:31 +00:00
Loader.preloadSprite had an extra guard added to ensure it didn't try to updateCrop a non-existent sprite (thanks @noidexe #1636)
This commit is contained in:
parent
eb8e99021b
commit
466a4d11bb
2 changed files with 10 additions and 1 deletions
|
@ -189,6 +189,7 @@ We've also removed functions and properties from Pixi classes that Phaser doesn'
|
|||
* Graphics.drawEllipse method was missing (thanks @jackrugile #1574)
|
||||
* A TweenData wouldn't take into account the `repeatDelay` property when repeating the tween, but now does. A TweenData also has a new property `yoyoDelay` which controls the delay before the yoyo will start, allowing you to set both independently (thanks @DreadKnight #1469)
|
||||
* Animation.update skips ahead frames when the system is lagging, however it failed to set the animation to the final frame in the sequence if the animation skipped ahead too far (thanks @richpixel #1628)
|
||||
* Loader.preloadSprite had an extra guard added to ensure it didn't try to updateCrop a non-existent sprite (thanks @noidexe #1636)
|
||||
|
||||
For changes in previous releases please see the extensive [Version History](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md).
|
||||
|
||||
|
|
|
@ -2161,7 +2161,15 @@ Phaser.Loader.prototype = {
|
|||
this.preloadSprite.rect.height = Math.floor((this.preloadSprite.height / 100) * this.progress);
|
||||
}
|
||||
|
||||
this.preloadSprite.sprite.updateCrop();
|
||||
if (this.preloadSprite.sprite)
|
||||
{
|
||||
this.preloadSprite.sprite.updateCrop();
|
||||
}
|
||||
else
|
||||
{
|
||||
// We seem to have lost our sprite - maybe it was destroyed?
|
||||
this.preloadSprite = null;
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue