A container of DoorControl instances
A container of cursor interaction elements. Contains cursors, rulers, interaction rectangles, and pings
Ruler tools, one per connected user
A graphics instance used for drawing debugging visualization
The Canvas selection rectangle
A mapping of user IDs to Cursor instances for quick access
Options for this layer instance.
Private
_rulersA mapping of user IDs to Ruler instances for quick access
Private
_offscreenThe positions of any offscreen pings we are tracking.
Private
#drawingAn internal reference to a Promise in-progress to draw the CanvasLayer.
Private
#drawnIs the layer drawn?
Is this layer currently active
The canonical name of the CanvasLayer is the name of the constructor that is the immediate child of the defined baseClass for the layer type.
canvas.lighting.name -> "LightingLayer"
The name used by hooks to construct their hook string. Note: You should override this getter if hookName should not return the class constructor name.
Static
layerStatic
instanceReturn a reference to the active instance of this canvas layer
Create and draw the Cursor object for a given User
The User document for whom to draw the cursor Container
Update the cursor when the user moves to a new position
The User for whom to update the cursor
The new cursor position
Update display of an active Ruler object for a user given provided data
The User for whom to update the ruler
Data which describes the new ruler measurement to display
Draw a ping at the edge of the viewport, pointing to the location of an off-screen ping.
The coordinates of the off-screen ping.
Optional
options: PingOptions = {}Additional options to configure how the ping is drawn.
A promise which resolves once the Ping has been drawn and animated
Ping#drawPing
Draw a ping on the canvas.
The position on the canvas that was pinged.
Optional
options: PingOptions = {}Additional options to configure how the ping is drawn.
A promise which resolves once the Ping has been drawn and animated
Activate the InteractionLayer, deactivating other layers and marking this layer's children as interactive.
Optional
options: { Options which configure layer activation
A specific tool in the control palette to set as active
The layer instance, now activated
Deactivate the InteractionLayer, removing interactivity from its children.
The layer instance, now inactive
Draw the canvas layer, rendering its internal components and returning a Promise. The Promise resolves to the drawn layer once its contents are successfully rendered.
Optional
options: object = {}Options which configure how the layer is drawn
Deconstruct data used in the current layer in preparation to re-draw the canvas
Optional
options: object = {}Options which configure how the layer is deconstructed
Protected
_onProtected
_onProtected
_activateProtected
_onProtected
_onProtected
_canProtected
Does the User have permission to left-click drag on the Canvas?
The User performing the action.
The event object.
Protected
_onProtected
_onProtected
_onProtected
_onProtected
_onProtected
_onProtected
_onPrivate
_findPrivate
Given off-screen coordinates, determine the closest point at the edge of the viewport to these coordinates.
The off-screen coordinates.
The closest point at the edge of the viewport to these coordinates and a ray cast from the centre of the screen towards it.
A CanvasLayer for displaying UI controls which are overlayed on top of other layers.
We track three types of events: