BaseState Class
Defines the base functionality for a state used by the state manager
Constructor
BaseState
-
panel
Parameters:
-
panel
createjs.MovieClip | PIXI.DisplayObjectContainerThe panel to associate with this panel
Item Index
Methods
- _internalCancel
- _internalEnterState
- _internalEnterStateDone
- _internalExitState
- _internalExitStateStart
- addEventListener
- cancel
- destroy
- dispatchEvent
- enterState
- enterStateDone
- exitState
- exitStateStart
- getActive
- getCanceled
- getDestroyed
- getEnabled
- hasEventListener
- initialize
- loadingDone
- loadingStart
- removeAllEventListeners
- removeEventListener
- setEnabled
- transitionIn
- transitionOut
- update
Methods
_internalCancel
()
private
Cancel the loading of this state
_internalEnterState
-
proceed
Exit the state start, called by the State Manager
Parameters:
-
proceed
FunctonThe function to call after enterState has been called
_internalEnterStateDone
()
private
Exit the state start, called by the State Manager
_internalExitState
()
private
This is called by the State Manager to exit the state
_internalExitStateStart
()
private
Exit the state start, called by the State Manager
cancel
()
Cancel the load, implementation-specific this is where any async actions are removed
destroy
()
Don't use the state object after this
dispatchEvent
-
enventObj
-
target
Dispatches the specified event
Parameters:
Returns:
Returns true if any listener returned true
enterState
()
When the state is entered
enterStateDone
()
When the state is visually entered fully that is, after the transition is done
exitState
()
When the state is exited
exitStateStart
()
When the state has requested to be exit, pre-transition
getActive
()
Bool
Get if this is the active state
Returns:
If this is the active state
getCanceled
()
Bool
Status of whether the panel load was canceled
Returns:
If the load was canceled
getDestroyed
()
Bool
Get if this State has been destroyed
Returns:
If this has been destroyed
getEnabled
()
Bool
Get the enabled status
Returns:
If this state is enabled
hasEventListener
-
type
Indicates whether there is at least one listener for the specified event type
Parameters:
-
type
StringThe string type of the event
Returns:
Returns true if there is at least one listener for the specified event
initialize
-
panel
Initialize the Base State
Parameters:
-
panel
createjs.MovieClip | PIXI.DisplayObjectContanerThe panel
loadingDone
()
Internal function to finish the preloading
loadingStart
()
Internal function to start the preloading
removeAllEventListeners
-
type
Removes all listeners for the specified type, or all listeners of all types
Parameters:
-
type
StringThe string type of the event. If omitted, all listeners for all types will be removed.
removeEventListener
-
type
-
listener
Removes the specified event listener
setEnabled
-
enabled
Enable this panel, true is only non-loading and non-transitioning state
Parameters:
-
enabled
BoolThe enabled state
update
-
elasped
StateManager updates the state
Parameters:
-
elasped
IntThe second since the last frame
Properties
_active
Bool
private
If the manager considers this the active panel
_canceled
Bool
private
If we canceled entering the state
_destroyed
Bool
private
Check to see if we've been destroyed
_enabled
Bool
private
_isLoading
Bool
private
If we are pre-loading the state
isTransitioning
Bool
private
If we are currently transitioning
panel
createjs.MovieClip | PIXI.DisplayObjectContainer
Save the panel