StateManager#start()

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)
doc_phaser
2017-02-14 11:13:11
Comments
Leave a Comment

Please login to continue.