mirror of
https://github.com/photonstorm/phaser
synced 2024-12-19 09:34:02 +00:00
1 line
13 KiB
JSON
1 line
13 KiB
JSON
|
{"class":{"name":"Phaser.StateManager","extends":"","static":false,"constructor":true,"parameters":[{"name":"game","type":["Phaser.Game"],"help":"A reference to the currently running game.","optional":false,"default":null},{"name":"pendingState","type":["Phaser.State","object"],"help":"A State object to seed the manager with.","optional":true,"default":"null"}],"help":"The State Manager is responsible for loading, setting up and switching game states."},"consts":[],"methods":{"public":[{"name":"add","static":false,"returns":null,"help":"Adds a new State into the StateManager. You must give each State a unique key by which you'll identify it.\\nThe State can be either a Phaser.State object (or an object that extends it), a plain JavaScript object or a function.\\nIf a function is given a new state object will be created by calling it.","line":171,"public":true,"protected":false,"private":false,"parameters":[{"name":"key","type":["string"],"help":"A unique key you use to reference this state, i.e. \"MainMenu\", \"Level1\".","optional":false,"default":null},{"name":"state","type":["Phaser.State","object","function"],"help":" - The state you want to switch to.","optional":false,"default":null},{"name":"autoStart","type":["boolean"],"help":" - If true the State will be started immediately after adding it.","optional":true,"default":"false"}],"inherited":false,"inheritedFrom":""},{"name":"checkState","static":false,"returns":{"types":["boolean"],"help":"true if the State has the required functions, otherwise false."},"help":"Checks if a given phaser state is valid. A State is considered valid if it has at least one of the core functions: preload, create, update or render.","line":422,"public":true,"protected":false,"private":false,"parameters":[{"name":"key","type":["string"],"help":"The key of the state you want to check.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"clearCurrentState","static":false,"returns":null,"help":"This method clears the current State, calling its shutdown callback. The process also removes any active tweens,\\nresets the camera, resets input, clears physics, removes timers and if set clears the world and cache too.","line":371,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"destroy","static":false,"returns":null,"help":"Removes all StateManager callback references to the State object, nulls the game reference and clears the States object.\\nYou don't recover from this without rebuilding the Phaser instance again.","line":723,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"getCurrentState","static":false,"returns":{"types":[],"help":[]},"help":"Gets the current State.","line":570,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"preUpdate","static":false,"returns":null,"help":"preUpdate is called right at the start of the game loop. It is responsible for changing to a new state that was requested previously.","line":311,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"remove","static":false,"returns":null,"help":"Delete the given state.","line":214,"public":true,"protected":false,"private":false,"parameters":[{"name":"key","type":["string"],"help":"A unique key you use to reference this state, i.e. \"MainMenu\", \"Level1\".","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"restart","static":false,"returns":null,"help":"Restarts the current State. State.shutDown will be called (if it exists) before the State is restarted.","line":281,"public":true,"protected":false,"private":false,"parameters":[{"name":"clearWorld","type":["boolean"],"help":"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)","optional":true,"default":"true"},{"name":"clearCache","type":["boolean"],"
|