mirror of
https://github.com/photonstorm/phaser
synced 2024-12-21 02:23:29 +00:00
1 line
No EOL
13 KiB
JSON
1 line
No EOL
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"],"help":"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.","optional":true,"default":"false"},{"name":"parameter","type":["any"],"help":"Additional parameters that will be passed to the State.init function if it has one.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"start","static":false,"returns":null,"help":"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.","line":248,"public":true,"protected":false,"private":false,"parameters":[{"name":"key","type":["string"],"help":"The key of the state you want to start.","optional":false,"default":null},{"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"],"help":"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.","optional":true,"default":"false"},{"name":"parameter","type":["any"],"help":"Additional parameters that will be passed to the State.init function (if it has one).","optional":false,"default":null}],"inherited":false,"inheritedFrom":""}],"protected":[{"name":"link","static":false,"returns":null,"help":"Links game properties to the State given by the key.","line":458,"public":false,"protected":true,"private":false,"parameters":[{"name":"key","type":["string"],"help":"State key.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"loadComplete","static":false,"returns":null,"help":"","line":578,"public":false,"protected":true,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"pause","static":false,"returns":null,"help":"","line":599,"public":false,"protected":true,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"pauseUpdate","static":false,"returns":null,"help":"","line":645,"public":false,"protected":true,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"preRender","static":false,"returns":null,"help":"","line":665,"public":false,"protected":true,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"render","static":false,"returns":null,"help":"","line":691,"public":false,"protected":true,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"resize","static":false,"returns":null,"help":"","line":678,"public":false,"protected":true,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"resume","static":false,"returns":null,"help":"","line":612,"public":false,"protected":true,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"unlink","static":false,"returns":null,"help":"Nulls all State level Phaser properties, including a reference to Game.","line":488,"public":false,"protected":true,"private":false,"parameters":[{"name":"key","type":["string"],"help":"State key.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"update","static":false,"returns":null,"help":"","line":625,"public":false,"protected":true,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""}],"private":[{"name":"boot","static":false,"returns":null,"help":"The Boot handler is called by Phaser.Game when it first starts up.","line":143,"public":false,"protected":false,"private":true,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"dummy","static":false,"returns":null,"help":"Used by onInit and onShutdown when those functions don't exist on the state","line":303,"public":false,"protected":false,"private":true,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"setCurrentState","static":false,"returns":null,"help":"Sets the current State. Should not be called directly (use StateManager.start)","line":521,"public":false,"protected":false,"private":true,"parameters":[{"name":"key","type":["string"],"help":"State key.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""}],"static":[]},"properties":{"public":[{"name":"current","type":["string"],"help":"","inlineHelp":"The current active State object (defaults to null).","line":67,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"game","type":["Phaser.Game"],"help":"","inlineHelp":"A reference to the currently running game.","line":22,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"onCreateCallback","type":["function"],"help":"","inlineHelp":"This is called when the state preload has finished and creation begins.","line":82,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"onInitCallback","type":["function"],"help":"","inlineHelp":"This is called when the state is set as the active state.","line":72,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"onLoadRenderCallback","type":["function"],"help":"","inlineHelp":"This is called when the State is rendered during the preload phase.","line":112,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"onLoadUpdateCallback","type":["function"],"help":"","inlineHelp":"This is called when the State is updated during the preload phase.","line":107,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"onPauseUpdateCallback","type":["function"],"help":"","inlineHelp":"This is called every frame while the game is paused.","line":127,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"onPausedCallback","type":["function"],"help":"","inlineHelp":"This is called when the game is paused.","line":117,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"onPreRenderCallback","type":["function"],"help":"","inlineHelp":"This is called before the state is rendered and before the stage is cleared.","line":102,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"onPreloadCallback","type":["function"],"help":"","inlineHelp":"This is called when the state starts to load assets.","line":77,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"onRenderCallback","type":["function"],"help":"","inlineHelp":"This is called post-render. It doesn't happen during preload (see onLoadRenderCallback).","line":92,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"onResizeCallback","type":["function"],"help":"","inlineHelp":"This is called if ScaleManager.scalemode is RESIZE and a resize event occurs. It's passed the new width and height.","line":97,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"onResumedCallback","type":["function"],"help":"","inlineHelp":"This is called when the game is resumed from a paused state.","line":122,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"onShutDownCallback","type":["function"],"help":"","inlineHelp":"This is called when the state is shut down (i.e. swapped to another state).","line":132,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"onUpdateCallback","type":["function"],"help":"","inlineHelp":"This is called when the state is updated, every game loop. It doesn't happen during preload (@see onLoadUpdateCallback).","line":87,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"states","type":["object"],"help":"","inlineHelp":"The object containing Phaser.States.","line":27,"default":null,"public":true,"protected":false,"private":false,"readOnly":false}],"protected":[],"private":[{"name":"_args","type":["array"],"help":"","inlineHelp":"Temporary container when you pass vars from one State to another.","line":62,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_clearCache","type":["boolean"],"help":"","inlineHelp":"Clear the cache when we switch state?","line":50,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_clearWorld","type":["boolean"],"help":"","inlineHelp":"Clear the world when we switch state?","line":44,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_created","type":["boolean"],"help":"","inlineHelp":"Flag that sets if the State has been created or not.","line":56,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_pendingState","type":["Phaser.State"],"help":"","inlineHelp":"The state to be switched to in the next frame.","line":33,"default":null,"public":false,"protected":false,"private":true,"readOnly":false}]}} |