start(key, clearWorld, clearCache, parameter)
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.
Parameters
Name | Type | Argument | Default | Description |
---|---|---|---|---|
key | string | The key of the state you want to start. | ||
clearWorld | boolean | <optional> | 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) |
clearCache | boolean | <optional> | 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. |
parameter | * | <repeatable> | Additional parameters that will be passed to the State.init function (if it has one). |
- Source code: core/StateManager.js (Line 262)
Please login to continue.