Closed NickHolder closed 10 years ago
This looks like a bug in js2hx as optional parameters should never come after non-optional ones. I'll get this fixed shortly.
Phaser Source code has parameter in the docs, but not in the method call:
/**
* Start the given State. If a State is already running then State.shutDown will be called (if it exists) before switching to the new State.
*
* @method Phaser.StateManager#start
* @param {string} key - The key of the state you want to start.
* @param {boolean} [clearWorld=true] - Clear everything in the world? This clears the World display list fully (but not the Stage, so if you've added your own objects to the Stage they will need managing directly)
* @param {boolean} [clearCache=false] - Clear the Game.Cache? This purges out all loaded assets. The default is false and you must have clearWorld=true if you want to clearCache as well.
* @param {...*} parameter - Additional parameters that will be passed to the State.init function (if it has one).
*/
start: function (key, clearWorld, clearCache) {
It's using variable length arguments. The function will read the special keyword "arguments" and load the arguments in that way.
There's a non optional parameter named "parameter" after optional parameters in phaser.core.StateManager
in start()
and also restart()