mirror of
https://github.com/wassname/phaser.git
synced 2026-07-19 11:26:26 +08:00
AnimationParser.spriteSheet wasn't taking the margin or spacing into account when calculating the numbers of sprites per row/column, nor was it allowing for extra power-of-two padding at the end (fix #482, thanks yig)
AnimationManager.add documentation said that 'frames' could be null, but the code couldn't handle this so it defaults to an empty array if none given (thanks yig) Also updated TypeScript definitions and StateManager.add docs.
This commit is contained in:
@@ -152,11 +152,14 @@ Phaser.StateManager.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Add a new State.
|
||||
* Adds a new State into the StateManager. You must give each State a unique key by which you'll identify it.
|
||||
* The State can be either a Phaser.State object (or an object that extends it), a plain JavaScript object or a function.
|
||||
* If a function is given a new state object will be created by calling it.
|
||||
*
|
||||
* @method Phaser.StateManager#add
|
||||
* @param key {string} - A unique key you use to reference this state, i.e. "MainMenu", "Level1".
|
||||
* @param state {State} - The state you want to switch to.
|
||||
* @param autoStart {boolean} - Start the state immediately after creating it? (default true)
|
||||
* @param {string} key - A unique key you use to reference this state, i.e. "MainMenu", "Level1".
|
||||
* @param {Phaser.State|object|function} state - The state you want to switch to.
|
||||
* @param {boolean} [autoStart=false] - If true the State will be started immediately after adding it.
|
||||
*/
|
||||
add: function (key, state, autoStart) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user