Cancels all promises on the api as well as our async channel
Returns the html element of the state
Should return whether to fade out the game state. This will then apply the right css classes for the fadeout and wait the delay before moving states
Returns if the state has an unload confirmation, this is the "Are you sure you want to leave the page" message.
Should return how many mulliseconds to fade in / out the state. Not recommended to override!
Time in milliseconds to fade out
Returns the states key
Returns if this state should get paused if it does not have focus
true to pause the updating of the game
Cleans up all click detectors
Internal callback when entering the state. Do not override!
Arbitrary data passed from the state which we are transferring from
Whether to call the onEnter callback
Internal method to compute the time to fade in / out
time to fade in / out in ms
Internal method to get the HTML of the game state.
Internal callback when the state is left. Do not override!
Internal app pause callback
Internal app resume callback
Internal callback before the state is left. Also is called on page unload
Internal callback from the manager. Do not override!
Transfers to a new state
The id of the new state
Callback when the app got paused (on android, this means in background)
Callback when the app got resumed (on android, this means in foreground again)
Background tick callback, called while the game is inactiev
Delta time in ms since last tick
Callback before leaving the game state or when the page is unloaded
Render callback
Delta time in ms since last render
Called when the screen resized
window/screen width
window/screen height
Shows a language chooser dialog
Tracks clicks on a given element and calls the given callback on this state. If you want to call another function wrap it inside a lambda.
The element to track clicks on
The handler to call
Click detector arguments