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 movieUrlURL of sub-movie (will use the dirname of the submovie as asset path) callbackFunction 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 dataReturns:
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 messageDataReturns:
The instance- Type
- this
-
setBackgroundColor()
-
Set the background color of the stage
-
setFramerate(framerate)
-
Set the framerate of the movie
Parameters:
Name Type Description framerateNumber frames per second -
setOptions(options) → {this}
-
Sets options on the stage
Parameters:
Name Type Description optionsObject Properties
Name Type Argument Default Description frameratenumber <optional>
30 Playback speed of the movie baseUrlstring <optional>
'.' The base URL to use to resolve urls. pluginUrlstring <optional>
'.' The base URL to use to resolve plugin location. pluginsArray <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 renderingTypeString 'crispEdges' -
unfreeze()
-
Unfreeze/initiate the loop