springroll.Application Class

Application is the main entry point for using SpringRoll, creating an application allows the creation of displays and adding of module functionality (e.g. sound, captions, etc). All timing and asynchronous events should be handled by the Application to control the play and pause. Any update, Ticker-type functions, should use the Applications update event.

var app = new Application();

Constructor

springroll.Application

(
  • [options]
  • [init=null]
)

Parameters:

  • [options] Object optional

    The options for creating the application, see springroll.ApplicationOptions for the specific options that can be overridden and set.

  • [init=null] Function optional

    The callback when initialized

Properties

_doInit

()
protected

Defined in _doInit:331

Initialize the application

_preInit

()
private

Defined in _preInit:262

The internal initialization

_tick

()
private

Defined in _tick:526

_tick would be bound in _tickCallback

addDisplay

(
  • id
  • displayConstructor
  • [options]
)
Display

Defined in addDisplay:450

Add a display. If this is the first display added, then it will be stored as this.display.

Parameters:

  • id String

    The id of the canvas element, this will be used to grab the Display later also the Display should be the one to called document.getElementById(id) and not the application sinc we don't care about the DOMElement as this point

  • displayConstructor Function

    The function to call to create the display instance

  • [options] Object optional

    Optional Display specific options

Returns:

Display:

The created display.

addPreloadAssets

(
  • app
  • assets
)
private

Add the preload assets to the list of assets to load

Parameters:

calculateDisplaySize

(
  • size
)
protected

Calculates the resizing of displays. By default, this limits the new size to the initial aspect ratio of the primary display. Override this function if you need variable aspect ratios.

Parameters:

  • size Object

    A size object containing the width and height of the resized container. The size parameter is also the output of the function, so the size properties are edited in place.

    • width Int

      The width of the resized container.

    • height Int

      The height of the resized container.

destroy

()

Inherited from springroll.EventDispatcher but overwritten in destroy:595

Destroys the application and all active displays and plugins

endGame

(
  • [exitType='game_completed']
)

Provided by the Container Client module.

Defined in endGame:104

Manually close the application, this can happen when playing through once

Parameters:

  • [exitType='game_completed'] String optional

    The type of exit

getCache

(
  • id
)
| Null

Defined in getCache:223

Get an asset from the cache by ID

Parameters:

  • id String

    The asset to fetch

Returns:

| Null:

The cached object or null if empty

getDisplay

(
  • id
)
Display

Defined in getDisplay:498

Gets a specific renderer by the canvas id.

Parameters:

  • id String

    The id of the canvas

Returns:

Display:

The requested display.

getDisplays

(
  • [each]
)
Array
deprecated

Defined in getDisplays:16

Deprecated: since version 0.3.5

See displays

Parameters:

  • [each] Function optional

    Iterator function, param is each method

Returns:

Array:

The collection of displays

has

(
  • name
  • [callback]
)
Boolean
Checks if the EventDispatcher has a specific listener or any listener for a given event.

Parameters:

  • name String
    The name of the single event type to check for
  • [callback] Function optional
    The listener function to check for. If omitted, checks for any listener.

Returns:

Boolean: If the EventDispatcher has the specified listener.

internalPaused

(
  • paused
)
protected

Defined in internalPaused:397

Handle the internal pause of the application

Parameters:

  • paused Boolean

    If the application should be paused or not

load

(
  • asset
  • [complete]
)

Defined in load:108

Load a single file with options.

Parameters:

  • asset Object

    The file resource to load

    • src String

      The file to load

    • [cache=false] Boolean optional

      If the result should be cached for later

    • [complete=null] Function optional

      Callback when finished

    • [progress=null] Function optional

      Callback on load progress, has a parameter which is the percentage loaded from 0 to 1.

    • [data] optional

      Additional data to attach to load is accessible in the loader's result.

  • [complete] Function optional

    The completed callback with a single parameter which is a result object. will only use if asset.complete is undefined.

load

(
  • source
  • complete
  • [progress]
  • [cache=false]
  • [data]
)

Defined in load:98

Simple load of a single file.

Parameters:

  • source String

    The file to load

  • complete Function

    The completed callback with a single parameters result object.

  • [progress] Function optional

    Update callback, return 0-1

  • [cache=false] Boolean optional

    Save to the asset cache after load

  • [data] optional

    The data to attach to load item

load

(
  • asset
  • [complete]
)

Defined in load:123

Load a single custom asset with options.

Parameters:

  • asset Object

    The single asset resource to load, properties will depend on the type of asset loading.

    • [complete=null] Function optional

      Callback when finished

    • [id=null] String optional

      The ID to attach to this asset

    • [cache=false] Boolean optional

      If the result should be cached for later

  • [complete] Function optional

    The completed callback with a single parameters which is a result object. will only use if asset.complete is undefined.

load

(
  • assets
  • [options]
)

Defined in load:148

Load a list of multiple assets and return array of result objects.

Parameters:

  • assets Array

    The list of assets. If each object has a id the result will be a mapped object.

  • [options] Function | Object optional

    Callback where the only parameter is the collection or map of the results, or the collection of load options.

    • [complete=null] Function optional

      The complete callback if using load options.

    • [taskDone=null] Function optional

      The callback when a single item is finished.

    • [progress=null] Function optional

      Callback percentage updates

    • [cacheAll=false] Boolean optional

      If tasks should be cached

    • [startAll=true] Boolean optional

      If tasks should be run in parallel

    • [type] String optional

      The default asset type of load, gets attached to each asset

load

(
  • assets
  • [options]
)

Defined in load:135

Load a map of multiple assets and return mapped result objects.

Parameters:

  • assets Object

    Load a map of assets.

  • [options] Function | Object optional

    Callback where the only parameter is the map of the results by ID, or the collection of load options.

    • [complete=null] Function optional

      The complete callback if using load options.

    • [taskDone=null] Function optional

      The callback when a single item is finished.

    • [progress=null] Function optional

      Callback percentage updates

    • [cacheAll=false] Boolean optional

      If tasks should be cached

    • [startAll=true] Boolean optional

      If tasks should be run in parallel

    • [type] String optional

      The default asset type of load, gets attached to each asset

off

(
  • name
  • callback
)
EventDispatcher
Remove the event listener

Parameters:

  • name String*
    The type of event string separated by spaces, if no name is specifed remove all listeners.
  • callback Function | Array*
    The listener function or collection of callback functions

Returns:

EventDispatcher: Return this EventDispatcher for chaining calls.

on

(
  • name
  • callback
  • [priority=0]
)
EventDispatcher
Add an event listener. The parameters for the listener functions depend on the event.

Parameters:

  • name String | Object
    The type of event (can be multiple events separated by spaces), or a map of events to handlers
  • callback Function | Array*
    The callback function when event is fired or an array of callbacks.
  • [priority=0] Int optional
    The priority of the event listener. Higher numbers are handled first.

Returns:

EventDispatcher: Return this EventDispatcher for chaining calls.

onAnimatorHint

(
  • data
)
private

Provided by the Hints module.

Defined in onAnimatorHint:103

Handle the animator event

Parameters:

  • data Object

    The animator data

onCaptionsMuted

(
  • e
)
private

Provided by the Container Client module.

Defined in onCaptionsMuted:254

Handler when the captions are muted

Parameters:

  • e Event

    The bellhop event

onCaptionsStyles

(
  • e
)
private

Provided by the Container Client module.

Defined in onCaptionsStyles:283

The captions style is being set

Parameters:

  • e Event

    The bellhop event

once

(
  • name
  • callback
  • [priority=0]
)
EventDispatcher
Add an event listener but only handle it one time.

Parameters:

  • name String | Object
    The type of event (can be multiple events separated by spaces), or a map of events to handlers
  • callback Function | Array*
    The callback function when event is fired or an array of callbacks.
  • [priority=0] Int optional
    The priority of the event listener. Higher numbers are handled first.

Returns:

EventDispatcher: Return this EventDispatcher for chaining calls.

onClose

()
private

Provided by the Container Client module.

Defined in onClose:331

Game container requests closing the application

onConfigLoaded

(
  • config
  • asset
  • assets
)
private

Defined in onConfigLoaded:179

Callback when the config is loaded

Parameters:

  • config Object

    The Loader result from the load

  • asset Object

    Original asset data

  • assets Array

    The array to add new load tasks to

onContextMuted

(
  • context
  • e
)
private

Provided by the Container Client module.

Defined in onContextMuted:268

Handler when the context is muted

Parameters:

  • context String

    The name of the sound context

  • e Event

    The bellhop event

onHidden

()
private

Defined in onHidden:63

Private listener for when the page is hidden.

onLoadComplete

(
  • done
  • results
)
private

Defined in onLoadComplete:194

Callback when tasks are completed

Parameters:

  • done Function

    Call when we're done

  • results Array

    The collection of final LoaderResult objects

onManifestsLoaded

(
  • tasks
)
private

Provided by the EaselJS States module.

Defined in onManifestsLoaded:92

Callback to when manifests have been loaded

Parameters:

  • tasks Array

    The collection of preload tasks

onPause

(
  • e
)
private

Provided by the Container Client module.

Defined in onPause:225

When the container pauses the application

Parameters:

  • e Event

    The Bellhop event

onPlayOptions

(
  • e
)
private

Provided by the Container Client module.

Defined in onPlayOptions:308

Handler when a application enters single play mode

Parameters:

  • e Event

    The Bellhop event

onPluginProgress

(
  • progress
)
private

Progress handler for the plugin load

Parameters:

  • progress Number

    Plugins preloaded amount from 0 - 1

onProgress

(
  • progress
)
private

Defined in onProgress:141

Callback when progress is finished

Parameters:

  • progress Number

    The amount loaded from 0 to 1

onSinglePlay

(
  • e
)
private

Provided by the Container Client module.

Defined in onSinglePlay:320

Handler when a application enters single play mode

Parameters:

  • e Event

    The Bellhop event

onSoundMuted

(
  • e
)
private

Provided by the Container Client module.

Defined in onSoundMuted:240

Handler when the sound is muted

Parameters:

  • e Event

    The bellhop event

onVisible

()
private

Defined in onVisible:73

Private listener for when the page is shown.

onVOHint

(
  • data
)
private

Provided by the Hints module.

Defined in onVOHint:77

Handle the VO event

Parameters:

onWindowError

(
  • error
)
private

Provided by the Container Client module.

Defined in onWindowError:159

Handle the window uncaught errors with the container

Parameters:

  • error Error

    Uncaught Error

onWindowResize

()
protected

Defined in onWindowResize:231

Handle the window resize events

onWindowUnload

()
private

Provided by the Container Client module.

Defined in onWindowUnload:146

Handler for when a window is unloaded

removeDisplay

(
  • id
)

Defined in removeDisplay:509

Removes and destroys a display

Parameters:

  • id String

    The Display's id (also the canvas ID)

setInterval

(
  • callback
  • delay
  • [useFrames=false]
)
springroll.DelayedCall

Defined in setInterval:581

Works just like window.setInterval but respects the pause state of the Application.

Parameters:

  • callback Function

    The callback function, passes one argument which is the DelayedCall instance

  • delay Int

    The time in milliseconds or the number of frames (useFrames must be true)

  • [useFrames=false] Boolean optional

    If the delay is frames (true) or millseconds (false)

Returns:

springroll.DelayedCall:

The object for pausing, restarting, destroying etc.

setTargetedTimeout

(
  • callback
  • timeInFrame=0
)
private

Makes a setTimeout with a time based on _msPerFrame and the amount of time spent in the current tick.

Parameters:

  • callback Function

    The tick function to call.

  • timeInFrame=0 Int

    The amount of time spent in the current tick in milliseconds.

setTimeout

(
  • callback
  • delay
  • [useFrames=false]
  • [autoDestroy=true]
)
springroll.DelayedCall

Defined in setTimeout:566

Works just like window.setTimeout but respects the pause state of the Application.

Parameters:

  • callback Function

    The callback function, passes one argument which is the DelayedCall instance

  • delay Int

    The time in milliseconds or the number of frames (useFrames must be true)

  • [useFrames=false] Boolean optional

    If the delay is frames (true) or millseconds (false)

  • [autoDestroy=true] type optional

    If the DelayedCall object should be destroyed after completing

Returns:

springroll.DelayedCall:

The object for pausing, restarting, destroying etc.

singlePlayEnd

() Boolean

Provided by the Container Client module.

Defined in singlePlayEnd:87

When a application is in singlePlay mode it will end. It's unnecessary to check if (this.singlePlay) just call the method and it will end the application if it can.

Returns:

Boolean:

If endGame is called

toString

() String

Defined in toString:632

The toString debugging method

Returns:

String:

The reprsentation of this class

trigger

(
  • type
  • arguments
)
Dispatch an event

Parameters:

  • type String
    The type of event to trigger
  • arguments
    Additional parameters for the listener functions.

triggerResize

()

Defined in triggerResize:165

Fire a resize event with the current width and height of the display

type

(
  • value
)
String
private
Return type of the value.

Parameters:

  • value

Returns:

String: The type

unload

(
  • assets
)

Defined in unload:194

Unload an asset or list of assets.

Parameters:

  • assets Array | String

    The collection of asset ids or single asset id. As an array, it can be a manifest with objects that contain an ID, or an array of multiple strings.

unloadAll

()

Defined in unloadAll:214

Unload all assets from the assets cache

_assetLoad

springroll.AssetLoad private

Defined in _assetLoad:69

The asset load for preloading

_destroyed

Boolean protected
If the dispatcher is destroyed

_displays

Array private

Defined in _displays:173

The collection of displays

_displaysMap

Object private

Defined in _displaysMap:180

The displays by canvas id

_enabled

Boolean private

Defined in _enabled:144

If the current application is enabled

_framerate

DOMElement private

Defined in _framerate:40

The framerate container

_lastFrameTime

Int private

Defined in _lastFrameTime:123

The number of ms since the last frame update

_listeners

Object private
The collection of listeners

_manifests

Object private

Provided by the EaselJS States module.

Defined in _manifests:51

The collection of loading assets by state

_maxHeight

Number private

Defined in _maxHeight:30

The maximum height of the primary display, compared to the original width.

_maxWidth

Number private

Defined in _maxWidth:23

The maximum width of the primary display, compared to the original height.

_msPerFrame

Int private

Defined in _msPerFrame:166

The number of milliseconds per frame

_music

String private

Provided by the Sound module.

Defined in _music:69

The current music alias playing

_musicInstance

SoundInstance private

Provided by the Sound module.

Defined in _musicInstance:76

The current music SoundInstance playing

_numLoaded

Int private

Defined in _numLoaded:76

The total number of assets loaded

_originalHeight

Int private

Defined in _originalHeight:44

The original height of the primary display, used to calculate the aspect ratio.

_originalWidth

Int private

Defined in _originalWidth:37

The original width of the primary display, used to calculate the aspect ratio.

_paused

Boolean private

Defined in _paused:137

If the current application is paused

_plugins

Array private static

Defined in _plugins:114

The collection of function references to call when initializing the application these are registered by external modules.

_progress

Number private

Defined in _progress:90

The current combined progress with plugin and asset load

Default: -1

_resizeElement

DOMElement | Window | Null private

Defined in _resizeElement:15

Dom element (or the window) to attach resize listeners and read the size from

Default: null

_resizeHelper

Object private

Defined in _resizeHelper:51

A helper object to avoid object creation each resize event.

_states

Object private

Provided by the States module.

Defined in _states:27

The collection of states

_tickCallback

Function private

Defined in _tickCallback:130

The bound callback for listening to tick events

_tickId

Number private

Defined in _tickId:151

The id of the active requestAnimationFrame or setTimeout call.

_time

Number private

Provided by the PIXI Display module.

Defined in _time:19

Keep track of total time elapsed to feed to the Ticker

Default: 0

_total

Int private

Defined in _total:83

The total assets to preload

_transition

createjs.MovieClip | springroll.easeljs.BitmapMovieClip | PIXI.Spine private

Provided by the States module.

Defined in _transition:40

The transition animation to use between the StateManager state changes

_useRAF

Bool private

Defined in _useRAF:158

If requestionAnimationFrame should be used

Default: false

_visibility

springroll.PageVisibility private

Defined in _visibility:17

Handles the page visiblity changes automatically to pause and resume the application

_windowResizer

springroll.DelayedCall private

Defined in _windowResizer:63

The timeout when the window is being resized

animator

springroll.Animator

Provided by the Animation module.

Defined in animator:20

The class for playing animation

assetManager

springroll.AssetManager private

Defined in assetManager:25

Reference to the asset manager.

autoPaused

Boolean protected

Defined in autoPaused:44

Setter for if the application is being automatically paused, usually by the PageVisibility plugin or the ContainerClient plugin.

captions

springroll.Captions

Provided by the Sound module.

Defined in captions:38

The global captions object

config

Object

Defined in config:63

The game configuration loaded from and external JSON file

container

Bellhop

Provided by the Container Client module.

Defined in container:23

Send a message to let the site know that this has been loaded, if the site is there

destroyed

Boolean
If the dispatcher is destroyed

display

Display public

Defined in display:49

Primary renderer for the application, for simply accessing Application.instance.display.stage; The first display added becomes the primary display automatically.

displays

Array

Defined in displays:485

Get all the displays

enabled

Boolean

Defined in enabled:356

Enables at the application level which enables and disables all the displays.

Default: true

filters

springroll.StringFilters

Defined in filters:17

The StringFilters instance

hasTouch

Boolean

Provided by the UI module.

Defined in hasTouch:32

If the current brower has touch input available

hints

springroll.HintsPlayer

Provided by the Hints module.

Defined in hints:20

The hint player API

init

Function

Defined in init:58

Override this to do post constructor initialization

instance

Application public static

Defined in instance:247

Get the singleton instance of the application

isAndroid

Boolean

Provided by the UI module.

Defined in isAndroid:26

If the current brower is Android

isIOS

Boolean

Provided by the UI module.

Defined in isIOS:20

If the current brower is iOS

languages

springroll.Languages

Provided by the Languages module.

Defined in languages:21

The StringFilters instance

loader

springroll.Loader

Defined in loader:19

Reference to the loader.

manager

springroll.StateManager

Provided by the States module.

Defined in manager:34

The state manager

manifests

Object

Provided by the EaselJS States module.

Defined in manifests:58

Read-only getter to return _manifests

music

String

Provided by the Sound module.

Defined in music:98

Get or set the current music alias to play

Default: null

musicInstance

SoundInstance

Provided by the Sound module.

Defined in musicInstance:137

The SoundInstance for the current music, for adjusting volume.

name

String

Defined in name:88

The name of the game, useful for debugging purposes

Default: ""

options

springroll.ApplicationOptions

Defined in options:41

Initialization options/query string parameters, these properties are read-only Application properties like raf, fps, don't have any affect on the options object.

options.audioPlugins

Array

Provided by the Sound module.

Defined in options.audioPlugins:23

The preferred order of SoundJS audio plugins to use.

Default: [WebAudioPlugin,FlashAudioPlugin]

options.audioTypes

Array

Provided by the Sound module.

Defined in options.audioTypes:47

The order in which file types are preferred, where "ogg" becomes a ".ogg" extension on all sound file urls.

Default: ['ogg','mp3']

options.autoPause

Boolean

The application pauses automatically when the window loses focus.

Default: true

options.basePath

String

Defined in options.basePath:56

The optional file path to prefix to any relative file requests. This is a great way to load all load requests with a CDN path.

options.cacheBust

Boolean

Override the end-user browser cache by adding "?cb=" to the end of each file path requested. Use for development, debugging only!

Default: DEBUG

options.canvasId

String

Defined in options.canvasId:36

The default display DOM ID name

options.captions

DOMElement | String | createjs.Text | PIXI.Text | PIXI.BitmapText

Provided by the Sound module.

Defined in options.captions:21

The captions text field object to use for the VOPlayer captions object.

Default: 'captions'

options.captionsPath

String

Provided by the Sound module.

Defined in options.captionsPath:30

The path to the captions file to preload.

Default: null

options.configPath

String

The path to the config file to load

Default: null

options.debug

Boolean

Defined in options.debug:19

Enable the Debug class. After initialization, this is a pass-through to Debug.enabled.

Default: true

options.debugRemote

String

The host computer for remote debugging, the debug module must be included to use this feature. Can be an IP address or host name. After initialization, setting this will still connect or disconect Debug for remote debugging. This is a write-only property.

options.defaultAssetType

String

Different displays offer flavors of the same asset definition. Instead of repeatedly defining the asset type property, it's possible to define a global default. If PIXI is your default display "pixi" is recommended as a value. If EaselJS is your default display "easeljs" is recommended.

options.display

Function

Defined in options.display:42

The name of the class to automatically instantiate as the display (e.g. springroll.PixiDisplay)

options.displayOptions

Object

Display specific setup options

options.enableHiDPI

Boolean

Whether to account for devicePixelRatio when rendering game

Default: false

options.forceFlashAudio

Boolean

Provided by the Sound module.

Defined in options.forceFlashAudio:39

For the Sound class to use the Flash plugin shim

Default: false

options.forceTouch

Boolean

Provided by the UI module.

Defined in options.forceTouch:42

Manually override the check for hasTouch (unminifed library version only)

Default: false

options.fps

Int

Defined in options.fps:22

The framerate to use for rendering the stage

Default: 60

options.framerate

String | DOMElement

The framerate container

options.keepFocus

Boolean

Provided by the Container Client module.

Defined in options.keepFocus:39

This option tells the container to always keep focus on the iframe even when the focus is lost. This is useful mostly if your Application requires keyboard input.

options.language

String

Provided by the Languages module.

Defined in options.language:27

Force a specific language

Default: null

options.languagesPath

String

Provided by the Languages module.

Defined in options.languagesPath:34

The path to the languages configuration file

Default: null

options.manifestsPath

String

Provided by the EaselJS States module.

Defined in options.manifestsPath:27

The path to the concatinated FLA exported manifests. It's useful to load all the manifests at once. This JSON object contains a dictionary of state alias and contains an array of manifest assets (e.g. {"id": "PlayButton", "src": "assets/images/button.png"}. Set to null and no manifest will be auto-loaded.

Default: null

options.maxHeight

Int

If doing uniform resizing, optional parameter to add a maximum height relative to the original width. This allows for "title-safe" responsiveness. Must be greater than the original height of the canvas.

options.maxWidth

Int

Defined in options.maxWidth:82

If doing uniform resizing, optional parameter to add a maximum width relative to the original height. This allows for "title-safe" responsiveness. Must be greater than the original width of the canvas.

options.minLogLevel

Int

Minimum log level from 0 to 4

Default: 0

options.mute

Boolean

Provided by the Sound module.

Defined in options.mute:59

Set the initial mute state of the all the audio (unminifed library version only)

Default: false

options.name

String

Defined in options.name:78

The name of the application

Default: ''

options.preload

String | Array | Object

Defined in options.preload:55

The collection of assets to preload, can be individual URLs or objects with keys src, complete, progress, etc.

Default: []

options.raf

Boolean

Defined in options.raf:15

Use Request Animation Frame API

Default: true

options.resizeElement

DOMElement | String

The element that the canvas is resized to fit.

Default: 'frame'

options.responsive

Boolean

If responsive is true, the width and height properties are adjusted on the <canvas> element. It's assumed that responsive applications will adjust their own elements. If responsive is false then the style properties are changed.

Default: false

options.state

Boolean

Provided by the States module.

Defined in options.state:112

The initial state to go to when everything is finished

Default: null

options.swfPath

String

Provided by the Sound module.

Defined in options.swfPath:31

The relative location to the FlashPlugin swf for SoundJS

Default: 'assets/swfs/'

options.transition

createjs.MovieClip | PIXI.Spine

Provided by the States module.

Defined in options.transition:120

The animation to use for the StateManager

options.transitionSounds

Object

Provided by the States module.

Defined in options.transitionSounds:126

The transition sounds to use for the state transition

options.transitionSounds.in

Object

Provided by the States module.

Defined in options.transitionSounds.in:131

The transition in sound alias or sound object

Default: null

options.transitionSounds.out

Object

Provided by the States module.

Defined in options.transitionSounds.out:137

The transition out sound alias or sound object

Default: null

options.uniformResize

Boolean

Whether to resize the displays to the original aspect ratio

Default: true

options.updateTween

Boolean

If using TweenJS, the Application will update the Tween itself.

Default: true

options.useQueryString

Boolean

Use the query string parameters for options overrides

Default: false

options.version

String

Defined in options.version:64

The current version number for your application. This number will automatically be appended to all file requests. For instance, if the version is "0.0.1" all file requests will be appended with "?v=0.0.1"

options.versionsFile

String

Path to a text file which contains explicit version numbers for each asset. This is useful for controlling the live browser cache. For instance, this text file would have an asset on each line followed by a number: assets/config/config.json 2 would load assets/config/config.json?v=2

paused

Boolean

Defined in paused:378

Manual pause for the entire application, this suspends anything driving the the application update events. Include Animator, Captions, Sound and other media playback.

playOptions

Object

Provided by the Container Client module.

Defined in playOptions:76

The optional play options to use if the application is played in "single play" mode. These options are passed from the application container to specify options that are used for this single play session. For instance, if you want the single play to focus on a certain level or curriculum such as { "shape": "square" }

pluginLoad

springroll.AssetLoad protected

Defined in pluginLoad:64

The preload progress

realHeight

Int

Defined in realHeight:159

The current height of the application, in real point values

realWidth

Int

Defined in realWidth:153

The current width of the application, in real point values

scaling

springroll.ScaleManager

Provided by the UI module.

Defined in scaling:25

The main ScaleManager for any display object references in the main game.

singlePlay

Boolean

Provided by the Container Client module.

Defined in singlePlay:66

The default play-mode for the application is continuous, if the application is running as part of a sequence is it considered in "single play" mode and the application will therefore close itself.

Default: false

sound

springroll.Sound

Provided by the Sound module.

Defined in sound:89

The global player for all audio, also accessible through singleton

states

Object

Provided by the States module.

Defined in states:149

The collection of states where the key is the state alias and value is the state display object

Default: null

transition

createjs.MovieClip | springroll.easeljs.BitmapMovieClip | PIXI.Spine

Provided by the States module.

Defined in transition:47

The transition animation to use between the StateManager state changes

userData

springroll.UserData

Provided by the Container Client module.

Defined in userData:31

The API for saving user data, default is to save data to the container, if not connected, it will save user data to local cookies

version

String static

Defined in version:102

The current version of the library

voPlayer

springroll.VOPlayer

Provided by the Sound module.

Defined in voPlayer:83

The global player for playing voice over

afterInit

Defined in afterInit:198

Fired when initialization of the application is done

beforeInit

Defined in beforeInit:203

Fired when before initialization of the application

configLoaded

Defined in configLoaded:27

The config has finished loading, in case you want to add additional tasks to the manager after this.

Event Payload:

  • config Object

    The JSON object for config

  • assets Array

    Container to add additional assets to

destroy

Defined in destroy:242

Fired when the application is destroyed

displayAdded

Defined in displayAdded:220

When a display is added.

Event Payload:

displayRemoved

Defined in displayRemoved:226

When a display is removed.

Event Payload:

  • [displayId] String optional

    The display alias

init

Defined in init:188

Fired when initialization of the application is ready

loaded

Defined in loaded:16

The game has finished loading

loading

Defined in loading:35

The game has started loading

Event Payload:

  • assets Array

    The list of tasks to preload

manifestLoaded

Provided by the EaselJS States module.

Defined in manifestLoaded:21

Event when the manifest is finished loading

Event Payload:

  • assets Array

    The object of additional assets to load

pause

Defined in pause:214

Fired when the pause state is toggled

Event Payload:

  • paused Boolean

    If the application is now paused

paused

Defined in paused:232

Fired when the application becomes paused

pluginProgress

Defined in pluginProgress:193

The handler for the plugin progress

progress

Defined in progress:21

The amount of progress of the preload from 0 to 1

Event Payload:

  • percentage Number

    The amount preloaded

resize

Defined in resize:75

Fired when a resize is called

Event Payload:

  • width Int

    The width of the resize element

  • height Int

    The height of the resize element

resumed

Defined in resumed:237

Fired when the application resumes from a paused state

soundReady

Provided by the Sound module.

Defined in soundReady:173

The sound is ready to use

stateAdded

Provided by the States module.

Defined in stateAdded:20

Fired when an event has been added

Event Payload:

update

Defined in update:208

Fired when an update is called, every frame update

Event Payload:

  • elasped Int

    The number of milliseconds since the last frame update