Skip to content

Commit 58fc733

Browse files
committed
The StateManager has a preRenderCallback option, which checks for a preRender function existing on the State, but it was never called. Have decided to add this in, so the core Game loop now calls state.preRender right before the renderer runs (thanks @AnderbergE phaserjs#869)
1 parent 35cb63f commit 58fc733

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Version 2.0.6 - "Jornhill" - -in development-
7575
* Removed the cacheKey parameters from the AnimationParser methods as they're no longer used.
7676
* Loader.isLoading is set to false if the filelist size is zero.
7777
* Sound.externalNode has had the `input` property dropped from it, bringing it back in line with the AudioNode spec (thanks @villetou, #840)
78+
* The StateManager has a preRenderCallback option, which checks for a preRender function existing on the State, but it was never called. Have decided to add this in, so the core Game loop now calls state.preRender right before the renderer runs (thanks @AnderbergE #869)
7879

7980
### CocoonJS Specific Updates
8081

src/core/Game.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,7 @@ Phaser.Game.prototype = {
656656

657657
if (this.renderType != Phaser.HEADLESS)
658658
{
659+
this.state.preRender();
659660
this.renderer.render(this.stage);
660661
this.plugins.render();
661662
this.state.render();

src/loader/Cache.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ Phaser.Cache.prototype = {
411411
},
412412

413413
/**
414-
* Add a new image.
414+
* Adds an Image file into the Cache. The file must have already been loaded, typically via Phaser.Loader.
415415
*
416416
* @method Phaser.Cache#addImage
417417
* @param {string} key - The unique key by which you will reference this object.
@@ -429,7 +429,7 @@ Phaser.Cache.prototype = {
429429
},
430430

431431
/**
432-
* Add a new sound.
432+
* Adds a Sound file into the Cache. The file must have already been loaded, typically via Phaser.Loader.
433433
*
434434
* @method Phaser.Cache#addSound
435435
* @param {string} key - Asset key for the sound.
@@ -455,7 +455,7 @@ Phaser.Cache.prototype = {
455455
},
456456

457457
/**
458-
* Reload a sound.
458+
* Reload a Sound file from the server.
459459
*
460460
* @method Phaser.Cache#reloadSound
461461
* @param {string} key - Asset key for the sound.

0 commit comments

Comments
 (0)