Stage

Stage

A Stage instance is the root of your movie. There should never be a need to instantiate a new Stage from within a movie.

new Stage(messageChannel)

Constructs the movie root, i.e. the global `stage`.
Parameters:
Name Type Description
messageChannel Object The messageChannel object used to communicate with the renderer

Mixes In

Methods

destroy() → {this}

Destroys the stage
Returns:
The instance
Type
this

destroyAsset()

Sends a `destroyAsset` message to the renderer

freeze()

Freeze/destroy the loop

loadAsset()

Sends a `loadAsset` message to the renderer

loadSubMovie(movieUrl, callback)

Loads a sub movie and runs it in the context of a new Movie object (should be provided by RunnerContext bootstrap)
Parameters:
Name Type Description
movieUrl URL of sub-movie (will use the dirname of the submovie as asset path)
callback Function A callback to be called when your movie has loaded. The callback will be called with it's first argument signifying an error. So, if the first argument is `null` you can assume the movie was loaded successfully.

post(data) → {this}

Sends data to the client.
Parameters:
Name Type Description
data
Returns:
The instance
Type
this

sendMessage(category, messageData) → {this}

Sends a message to the renderer / stage controller
Parameters:
Name Type Argument Default Description
category <optional>
null The message category
messageData
Returns:
The instance
Type
this

setBackgroundColor()

Set the background color of the stage

setFramerate(framerate)

Set the framerate of the movie
Parameters:
Name Type Description
framerate Number frames per second

setOptions(options) → {this}

Sets options on the stage
Parameters:
Name Type Description
options Object
Properties
Name Type Argument Default Description
framerate number <optional>
30 Playback speed of the movie
baseUrl string <optional>
'.' The base URL to use to resolve urls.
pluginUrl string <optional>
'.' The base URL to use to resolve plugin location.
plugins Array <optional>
A list of plugin names to load.
Returns:
the stage intance.
Type
this

setRendering(renderingType)

Set the technique for rendering, currently only supporting value, 'crispEdges'.
Parameters:
Name Type Description
renderingType String 'crispEdges'

unfreeze()

Unfreeze/initiate the loop