The display provides the base properties for all custom display. A display is a specialized view for the application. As the name suggests, this class should not be instanciated directly.
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
For the re-render
resize
width
height
Resizes the canvas. 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.
adapter
Some of the modules require a special display adapter to provide common methods for managing display objects.
Default: null
enabled
If input is enabled on the stage for this display. The default is true. Without a rendering library, this does not actually have an effect.
height
Convenience method for getting the height of the canvas element would be the same thing as canvas.height
paused
If rendering is paused on this display only. Pausing all displays can be done using Application.paused setter.
visible
If the display is visible, using "display: none" css on the canvas. Invisible displays won't render.
visibility
Visibility changed on the display
visible
Boolean
Current state of the visibility