springroll.easeljs.Cutscene Class

Cutscene is a class for playing a single EaselJS animation synced to a single audio file with springroll.Sound, with optional captions.

Constructor

springroll.easeljs.Cutscene

(
  • options
)

Parameters:

  • options Object

    The runtime specific setup data for the cutscene.

    • clip createjs.Container

      The movieclip animation

    • width Int

      The width of the animation

    • height Int

      The height of the animation

    • display String | springroll.AbstractDisplay

      The display or display id of the EaselJSDisplay to draw on.

    • audio Array

      The audio being played

    • [imageScale=1] Number optional

      Scaling to apply to all images loaded for the Cutscene.

    • [captions] springroll.Captions optional

      A Captions instance to display captions text on.

_audioCallback

()
private

Defined in _audioCallback:265

Callback for when the audio has finished playing.

audioSorter

()
private

Defined in audioSorter:169

Audio sort based on the start time

cacheByBounds

(
  • [buffer=0]
  • [scale=1]
)
Does a cache by the nominalBounds set from Flash

Parameters:

  • [buffer=0] Int optional
    The space around the nominal bounds to include in cache image
  • [scale=1] Number optional
    The scale to cache the container by.

cacheByRect

(
  • rect
  • [buffer=0]
  • [scale=1]
)
Does a cache by a given rectangle

Parameters:

  • rect createjs.Rectangle
    The rectangle to cache with.
  • [buffer=0] Int optional
    Additional space around the rectangle to include in cache image
  • [scale=1] Number optional
    The scale to cache the container by.

destroy

()

Defined in destroy:463

Destroys the cutscene.

resize

(
  • width
  • height
)
private

Defined in resize:179

Listener for when the Application is resized.

Parameters:

  • width Int

    The new width of the display.

  • height Int

    The new height of the display.

start

(
  • callback
)

Defined in start:210

Starts playing the cutscene.

Parameters:

  • callback Function

    The function to call when playback is complete.

stop

(
  • [doCallback=false]
)

Defined in stop:426

Stops playback of the cutscene.

Parameters:

  • [doCallback=false] Boolean optional

    If the end callback should be performed.

update

(
  • elapsed
)
private

Defined in update:319

Listener for frame updates.

Parameters:

  • elapsed Int

    Time in milliseconds

_activeAudio

Array private

Defined in _activeAudio:113

Array of active SoundInstances that are not the currently synced one.

_activeSyncAudio

Array private

Defined in _activeSyncAudio:98

The queue of sound instances of playing audio that the animation should be synced to. Only the most recent active one will be synced to.

_audio

Array private

Defined in _audio:75

Time sorted list of audio that needs to be played, as well as information on if they should be synced or not.

_audioFinished

Boolean private

Defined in _audioFinished:120

If the audio has finished playing.

_audioIndex

Int private

Defined in _audioIndex:84

Index of the sound that is next up in _audio.

_captions

Captions private

Defined in _captions:134

The Captions object to use to manage captions.

_clip

createjs.MovieClip private

Defined in _clip:91

The clip that is being animated.

_elapsedTime

Number private

Defined in _elapsedTime:68

The time elapsed in seconds.

_endCallback

Function private

Defined in _endCallback:127

The function to call when playback is complete.

_soundStartTime

Number private

Defined in _soundStartTime:106

The time in seconds into the animation that the current synced audio started.

display

Display private

Defined in display:47

Reference to the display we are drawing on

height

Number private

Defined in height:61

The designed height of the animation

width

Number private

Defined in width:54

The designed width of the animation