API Documentation for: 1.1.2
Show:

BaseState Class

Defined in: BaseState:13
Namespace: cloudkid

Defines the base functionality for a state used by the state manager

Constructor

BaseState

(
  • panel
)

Defined in BaseState:13

Parameters:

  • panel createjs.MovieClip | PIXI.DisplayObjectContainer

    The panel to associate with this panel

Methods

_internalCancel

() private

Defined in _internalCancel:307

Cancel the loading of this state

_internalEnterState

(
  • proceed
)
private

Exit the state start, called by the State Manager

Parameters:

  • proceed Functon

    The 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

addEventListener

(
  • type
  • listener
)
Function | Object

Defined in addEventListener:27

Adds the specified event listener

Parameters:

  • type String

    The string type of the event

  • listener Function | Object

    An object with a handleEvent method, or a function that will be called when the event is dispatched

Returns:

Function | Object:

Returns the listener for chaining or assignment

cancel

()

Defined in cancel:323

Cancel the load, implementation-specific this is where any async actions are removed

destroy

()

Defined in destroy:463

Don't use the state object after this

dispatchEvent

(
  • enventObj
  • target
)
Bool

Defined in dispatchEvent:51

Dispatches the specified event

Parameters:

  • enventObj Object | String

    An object with a "type" property, or a string type

  • target Object

    The object to use as the target property of the event object

Returns:

Bool:

Returns true if any listener returned true

enterState

()

Defined in enterState:331

When the state is entered

enterStateDone

()

Defined in enterStateDone:352

When the state is visually entered fully that is, after the transition is done

exitState

()

Defined in exitState:203

When the state is exited

exitStateStart

()

Defined in exitStateStart:221

When the state has requested to be exit, pre-transition

getActive

() Bool

Defined in getActive:368

Get if this is the active state

Returns:

Bool:

If this is the active state

getCanceled

() Bool

Defined in getCanceled:171

Status of whether the panel load was canceled

Returns:

Bool:

If the load was canceled

getDestroyed

() Bool

Defined in getDestroyed:430

Get if this State has been destroyed

Returns:

Bool:

If this has been destroyed

getEnabled

() Bool

Defined in getEnabled:452

Get the enabled status

Returns:

Bool:

If this state is enabled

hasEventListener

(
  • type
)
Bool

Defined in hasEventListener:60

Indicates whether there is at least one listener for the specified event type

Parameters:

  • type String

    The string type of the event

Returns:

Bool:

Returns true if there is at least one listener for the specified event

initialize

(
  • panel
)

Defined in initialize:161

Initialize the Base State

Parameters:

  • panel createjs.MovieClip | PIXI.DisplayObjectContaner

    The panel

loadingDone

()

Defined in loadingDone:284

Internal function to finish the preloading

loadingStart

()

Defined in loadingStart:259

Internal function to start the preloading

removeAllEventListeners

(
  • type
)

Removes all listeners for the specified type, or all listeners of all types

Parameters:

  • type String

    The string type of the event. If omitted, all listeners for all types will be removed.

removeEventListener

(
  • type
  • listener
)

Removes the specified event listener

Parameters:

  • type String

    The string type of the event

  • listener Function | Object

    The listener function or object

setEnabled

(
  • enabled
)

Defined in setEnabled:441

Enable this panel, true is only non-loading and non-transitioning state

Parameters:

  • enabled Bool

    The enabled state

transitionIn

(
  • callback
)

Defined in transitionIn:379

Transition the panel in

Parameters:

transitionOut

(
  • callback
)

Defined in transitionOut:404

Transition the panel out

Parameters:

update

(
  • elasped
)

Defined in update:360

StateManager updates the state

Parameters:

  • elasped Int

    The second since the last frame

Properties

_active

Bool private

Defined in _active:107

If the manager considers this the active panel

_canceled

Bool private

Defined in _canceled:123

If we canceled entering the state

_destroyed

Bool private

Defined in _destroyed:99

Check to see if we've been destroyed

_enabled

Bool private

Defined in _enabled:146

_isLoading

Bool private

Defined in _isLoading:115

If we are pre-loading the state

_listeners description

Array private

Createjs EventDispatcher method

_onEnterStateProceed

Function private

When we're finishing loading

_onLoadingComplete

Function private

isTransitioning

Bool private

Defined in isTransitioning:153

If we are currently transitioning

manager

StateManager

Defined in manager:85

A reference to the state manager

panel

createjs.MovieClip | PIXI.DisplayObjectContainer

Defined in panel:92

Save the panel

stateID

String

Defined in stateID:78

The id reference