springroll.HintsPlayer Class

Module: Hints

Design to handle the setting and playing of hints

Constructor

springroll.HintsPlayer

(
  • app
)

Parameters:

_clearOldHints

()
private

Defined in _clearOldHints:343

Destroys old hints

_done

(
  • [cancelled=false]
)
private

Defined in _done:322

Internal callback when a hint is done playing

Parameters:

  • [cancelled=false] Boolean optional

    If the function was interrupted by the user or something else.

_update

(
  • elapsed
)
private

Defined in _update:296

Handle the update function

Parameters:

  • elapsed Int

    Number of milliseconds since the last update

anim

(
  • instance
  • events
  • onComplete
  • [onCancel]
)
springroll.AnimatorHint

Defined in anim:136

Add an animator hint to the player

Parameters:

  • instance createjs.MovieClip |

    The instance of the clip to play with Animator

  • events String | Array | Object

    The event aliases to play, see Animator.play

  • onComplete Function

    Call when the VO is done playing

  • [onCancel] Function | Boolean optional

    Call when the VO is cancelled playing, a value of true sets onComplete to also be the onCancelled callback.

Returns:

springroll.AnimatorHint:

The newly added hint

clear

()

Defined in clear:199

Removes the current hint

destroy

()

Defined in destroy:360

Destroy, don't use after this

func

(
  • onStart
)
springroll.FunctionHint

Defined in func:158

Add an animator hint to the player. If you use this hinting method, you NEED to re-enable the hinting when it's done. Whereas the VO and ANIM methods with automatically re-enable the hinting button.

Parameters:

  • onStart Function

    The function to call when hint is played. Should accept 2 arguments (callbacks): onComplete, onCancelled and call them when complete or cancelled

Returns:

springroll.FunctionHint:

The newly added hint

funcDone

(
  • [cancelled=false]
)

Defined in funcDone:317

Call this when a FunctionHint is done playing to reset HintsPlayer

Parameters:

  • [cancelled=false] Boolean optional

    If the function was interrupted by the user or something else.

group

() springroll.GroupHint

Defined in group:173

Create the new group hint for randomizing hints or for tiered hinting. You can save this group hint for later and assign using HintsPlayer.set()

Returns:

springroll.GroupHint:

The new group hint

play

() springroll.HintsPlayer

Defined in play:215

Manually play the current hint

Returns:

springroll.HintsPlayer:

instance of the player for chaining

removeTimer

() springroll.HintsPlayer

Defined in removeTimer:259

Stop the timer and remove update listener. Alias for stopTimer

Returns:

springroll.HintsPlayer:

instance of the player for chaining

resetTimer

() springroll.HintsPlayer

Defined in resetTimer:272

Reset the timer to start over

Returns:

springroll.HintsPlayer:

instance of the player for chaining

set

(
  • hint
)
springroll.AbstractHint

Defined in set:184

Set the current method to use

Parameters:

Returns:

springroll.AbstractHint:

Instance of the player, for chaining

startTimer

(
  • [duration=12000]
)
springroll.HintsPlayer

Defined in startTimer:240

Start a timer

Parameters:

  • [duration=12000] Int optional

    The number of milliseconds before playing hint

Returns:

springroll.HintsPlayer:

instance of the player for chaining

stopTimer

() springroll.HintsPlayer

Defined in stopTimer:253

Stop the timer and remove update listener

Returns:

springroll.HintsPlayer:

instance of the player for chaining

vo

(
  • idOrList
  • onComplete
  • [onCancel]
)
springroll.VOHint

Defined in vo:116

Add a VO hint to the player.

Parameters:

  • idOrList String | Array

    The list of VO element, see VOPlayer.play

  • onComplete Function

    Call when the VO is done playing

  • [onCancel] Function | Boolean optional

    Call when the VO is cancelled playing, a value of true sets onComplete to also be the onCancelled callback.

Returns:

springroll.VOHint:

The newly added hint

_app

springroll.Application private

Defined in _app:25

Reference to the current app

_duration

Int private

Defined in _duration:39

The total number of milliseconds until playing

_hint

springroll.AbstractHint private

Defined in _hint:32

The currently selected hint

_oldHints

Array

Defined in _oldHints:73

Contains previously set hints to be cleaned up after the new hint plays, to prevent erasing callbacks too soon.

_playing

Boolean private

Defined in _playing:65

If a hint is currently playing

Default: false

_timer

Int private

Defined in _timer:46

The countdown in milliseconds

enabled

Boolean

Defined in enabled:284

If the help button is enabled

timerDuration

Number

Defined in timerDuration:53

Time in ms between timeout lines

Default: 12000

anim

Defined in anim:91

Play an animation event

Event Payload:

enabled

Defined in enabled:110

Event when the enabled status of the hint changes

Event Payload:

  • enabled Boolean

    If the player is enabled

start

Defined in start:85

Play an animation event

Event Payload:

vo

Defined in vo:101

Play an Voice-Over event

Event Payload:

  • data Object

    The event data

    • events String | Array

      The VO alias or array of aliases/times/etc

    • complete Function

      Callback when complete

    • cancel Function

      Callback when canceled