EaselJSDisplay is a display plugin for the springroll Framework that uses the EaselJS library for rendering.
springroll.easeljs.EaselJSDisplay
id
options
id
String
The id of the canvas element on the page to draw to.
options
Object
The setup data for the EaselJS stage.
[stageType="stage"]
String
optional
If the stage should be a normal stage or a SpriteStage (use "spriteStage").
[clearView=false]
Boolean
optional
If the stage should wipe the canvas between renders.
[mouseOverRate=30]
Int
optional
How many times per second to check for mouseovers. To disable them, use 0 or -1.
[autoPreventDefault=true]
Boolean
optional
If preventDefault() should be called on all touch events and mousedown events.
destroy
Destroys the display. This method is called by the Application and should not be called directly, use Application.removeDisplay(id). The stage recursively removes all display objects here.
has
name
[callback]
Checks if the EventDispatcher has a specific listener or any listener for a given event.
If the EventDispatcher has the specified listener.
off
name
callback
Remove the event listener
Return this EventDispatcher for chaining calls.
on
name
callback
[priority=0]
Add an event listener. The parameters for the listener functions depend on the event.
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.
Return this EventDispatcher for chaining calls.
once
name
callback
[priority=0]
Add an event listener but only handle it one time.
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.
Return this EventDispatcher for chaining calls.
render
elapsed
[force=false]
Updates the stage and draws it. This is only called by the Application. This method does nothing if paused is true or visible is false.
elapsed
Int
The time elapsed since the previous frame.
[force=false]
Boolean
optional
Will re-render even if the game is paused or not visible
resize
width
height
width
Int
height
Int
trigger
type
arguments
Dispatch an event
type
String
The type of event to trigger
arguments
Additional parameters for the listener functions.
_autoPreventDefault
If preventDefault() should be called on all touch events and mousedown events. Defaults to true.
adapter
Default: null
autoPreventDefault
If preventDefault() should be called on all touch events and mousedown events. Defaults to true.
DELTA_HELPER
An internal helper to avoid creating an object each render while telling EaselJS the amount of time elapsed.
height
keepMouseover
If the display should keep mouse move events running when the display is disabled.
mouseOverRate
The rate at which EaselJS calculates mouseover events, in times/second.
Default: 30
paused
stage
The rendering library's stage element, the root display object
visible
visibility
visible
Boolean