mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 15:14:47 +00:00
ScenePlugin.getIndex will return the index of the given Scene in the Scene List.
This commit is contained in:
parent
1c4d6551b0
commit
5d3c06d8b7
2 changed files with 20 additions and 0 deletions
|
@ -41,6 +41,7 @@ The Loader has been given a slight overhaul to improve its performance and exten
|
|||
* TextureSource will now automatically create a glTexture from its canvas if using one.
|
||||
* WebGLRenderer will now remove a GL texture from its local `nativeTextures` array when you call the `deleteTexture` method.
|
||||
* The BaseCache has a new method `exists` that will return a boolean if an entry for the given key exists in the cache or not.
|
||||
* ScenePlugin.getIndex will return the index of the given Scene in the Scene List.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
|
@ -54,6 +55,8 @@ The Loader has been given a slight overhaul to improve its performance and exten
|
|||
* Text objects with word wrapping enabled would gain an extra space at the end of the line. These are now only added when the word index is greater than the previous one. Fix #3626 (thanks @rexrainbow)
|
||||
* Container.getBounds now checks if it can call `getBounds` on its children before doing so, as some do not have this method (such as Graphics objects) so they no longer cause the call to crash. Fix #3623 (thanks @poasher)
|
||||
* The Animation Component `setProgress` method was setting the frame on the wrong object. Fix #3633 (thanks @benhhopkins)
|
||||
* SceneManager.moveAbove wouldn't move the Scene if it was already above the target Scene. Now it moves to be directly above the target Scene no matter where in the Scene List it is.
|
||||
* SceneManager.moveBelow wouldn't move the Scene if it was already below the target Scene. Now it moves to be directly below the target Scene no matter where in the Scene List it is.
|
||||
|
||||
### Examples, Documentation and TypeScript
|
||||
|
||||
|
|
|
@ -900,6 +900,23 @@ var ScenePlugin = new Class({
|
|||
return this.manager.getScene(key);
|
||||
},
|
||||
|
||||
/**
|
||||
* Retrieves the numeric index of a Scene in the Scenes list.
|
||||
*
|
||||
* @method Phaser.Scenes.ScenePlugin#getIndex
|
||||
* @since 3.7.0
|
||||
*
|
||||
* @param {(string|Phaser.Scene)} [key] - The Scene to get the index of.
|
||||
*
|
||||
* @return {integer} The index of the Scene.
|
||||
*/
|
||||
getIndex: function (key)
|
||||
{
|
||||
if (key === undefined) { key = this.key; }
|
||||
|
||||
return this.manager.getIndex(key);
|
||||
},
|
||||
|
||||
/**
|
||||
* The Scene that owns this plugin is shutting down.
|
||||
* We need to kill and reset all internal properties as well as stop listening to Scene events.
|
||||
|
|
Loading…
Reference in a new issue