API Document Index



Class me.state


Defined in: <build/melonJS-0.9.3.js>.

Class Summary
Constructor Attributes Constructor Name and Description
 
a State Manager (state machine)

There is no constructor function for me.state.

Field Summary
Field Attributes Field Name and Description
<constant>  
default state value for Credits Screen
<constant>  
default state value for Game End Screen
<constant>  
default state value for Game Over Screen
<constant>  
default state value for Loading Screen
<constant>  
default state value for Menu Screen
 
onPause callback
 
onResume callback
<constant>  
default state value for Play Screen
<constant>  
default state value for "Ready" Screen
<constant>  
default state value for High Score Screen
<constant>  
default state value for Settings Screen
Method Summary
Method Attributes Method Name and Description
 
change(state, args)
change the game/app state
 
return a reference to the current screen object
useful to call a object specific method
 
isCurrent(state)
return true if the specified state is the current one
 
isRunning(true)
return the running state of the state manager
 
pause(pauseTrack)
pause the current screen object
 
resume(resumeTrack)
resume the resume screen object
 
set(state, so)
associate the specified state with a screen object
 
enable/disable transition for a specific state (by default enabled for all)
 
transition(effect, color, duration)
specify a global transition effect
Class Detail
me.state()
a State Manager (state machine)

There is no constructor function for me.state.

Field Detail
<constant> CREDITS
default state value for Credits Screen

<constant> GAME_END
default state value for Game End Screen

<constant> GAMEOVER
default state value for Game Over Screen

<constant> LOADING
default state value for Loading Screen

<constant> MENU
default state value for Menu Screen

{function} onPause
onPause callback

{function} onResume
onResume callback

<constant> PLAY
default state value for Play Screen

<constant> READY
default state value for "Ready" Screen

<constant> SCORE
default state value for High Score Screen

<constant> SETTINGS
default state value for Settings Screen
Method Detail
change(state, args)
change the game/app state
Parameters:
{Int} state
@see me.state#Constant
{Arguments} args Optional
extra arguments to be passed to the reset functions

{me.ScreenObject} current()
return a reference to the current screen object
useful to call a object specific method
Returns:
{me.ScreenObject} so

isCurrent(state)
return true if the specified state is the current one
Parameters:
{Int} state
@see me.state#Constant

isRunning(true)
return the running state of the state manager
Parameters:
{Boolean} true
if a "process is running"

pause(pauseTrack)
pause the current screen object
Parameters:
{Boolean} pauseTrack
pause current track on screen pause

resume(resumeTrack)
resume the resume screen object
Parameters:
{Boolean} resumeTrack
resume current track on screen resume

set(state, so)
associate the specified state with a screen object
Parameters:
{Int} state
@see me.state#Constant
{me.ScreenObject} so

setTransition()
enable/disable transition for a specific state (by default enabled for all)

transition(effect, color, duration)
specify a global transition effect
Parameters:
{String} effect
(only "fade" is supported for now)
{String} color
in RGB format (e.g. "#000000")
{Int} duration Optional, Default: "1000"
in ms

Documentation generated by JsDoc Toolkit 2.4.0 on Tue May 01 2012 12:00:50 GMT+0800 (CST)