PixiDisplay is a display plugin for the springroll Framework that uses the Pixi library for rendering.
springroll.pixi.PixiDisplay
id
options
id
String
The id of the canvas element on the page to draw to.
options
Object
The setup data for the Pixi stage.
[forceContext=null]
String
optional
If a specific renderer should be used instead of WebGL falling back to Canvas. Use "webgl" or "canvas2d" to specify a renderer.
[clearView=false]
Boolean
optional
If the canvas should be wiped between renders.
[backgroundColor=0x000000]
Uint
optional
The background color of the stage (if it is not transparent).
[transparent=false]
Boolean
optional
If the stage should be transparent.
[antiAlias=false]
Boolean
optional
If the WebGL renderer should use anti-aliasing.
[preMultAlpha=false]
Boolean
optional
If the WebGL renderer should draw with all images as pre-multiplied alpha. In most cases, you probably do not want to set this option to true.
[preserveDrawingBuffer=false]
Boolean
optional
Set this to true if you want to call toDataUrl on the WebGL rendering context.
[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).
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
[force=false]
Boolean
optional
Will re-render even if the game is paused or not visible
resize
width
height
Resizes the canvas and the renderer. This is only called by the Application.
width
Int
The width that the display should be
height
Int
The height that the display should be
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.
height
keepMouseover
If the display should keep mouse move events running when the display is disabled.
paused
visible
visibility
visible
Boolean