Placeable Layer Objects
Preview Object Placement
Keep track of history so that CTRL+Z can undo changes
Keep track of an object copied with CTRL+C which can be pasted later
A Quadtree which partitions and organizes Walls into quadrants for efficient target identification.
Track whether "highlight all objects" is currently active
Options for this layer instance.
Private
_tabThe current index position in the tab cycle
Private
#drawingAn internal reference to a Promise in-progress to draw the CanvasLayer.
Private
#drawnIs the layer drawn?
Static
documentA reference to the named Document type which is contained within this Canvas Layer.
Static
SORT_Sort order for placeables belonging to this layer.
Static
CREATION_Creation states affected to placeables during their construction.
The set of tokens that trigger occlusion (a union of CONST.TOKEN_OCCLUSION_MODES).
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.
Token objects on this layer utilize the TokenHUD
Obtain a reference to the Collection of embedded Document instances within the currently viewed Scene
A convenience method for accessing the placeable object instances contained in this layer
An Array of placeable objects in this layer which have the _controlled attribute
Track the set of PlaceableObjects on this layer which are currently controlled.
Track the PlaceableObject on this layer which is currently hovered upon.
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"
Static
layerConfiguration options for the PlaceablesLayer.
Static
placeableObtain a reference to the PlaceableObject class definition which represents the Document type in this layer.
Static
instanceReturn a reference to the active instance of this canvas layer
Internal
An internal helper method to identify the array of PlaceableObjects which can be moved or rotated.
An explicit array of IDs requested.
Include locked objects which would otherwise be ignored?
An array of objects which can be moved or rotated
An error if any explicitly requested ID is not valid
Target all Token instances which fall within a coordinate rectangle.
The selection rectangle.
The top-left x-coordinate of the selection rectangle
The top-left y-coordinate of the selection rectangle
The width of the selection rectangle
The height of the selection rectangle
Optional
options: { Additional options to configure targeting behaviour.
Whether or not to release other targeted tokens
The number of Token instances which were targeted.
Cycle the controlled token by rotating through the list of Owned Tokens that are available within the Scene Tokens are currently sorted in order of their TokenID
Which direction to cycle. A truthy value cycles forward, while a false value cycles backwards.
Restart the cycle order back at the beginning?
The Token object which was cycled to, or null
Iterates over placeable objects that are eligible for control/select.
A placeable object
Draw a single placeable object
The Document instance used to create the placeable object
Get a PlaceableObject contained in this layer by its ID. Returns undefined if the object doesn't exist or if the canvas is not rendering a Scene.
The ID of the contained object to retrieve
The object instance, or undefined
Acquire control over all PlaceableObject instances which are visible and controllable within the layer.
Options passed to the control method of each object
An array of objects that were controlled
Simultaneously rotate multiple PlaceableObjects using a provided angle or incremental. This executes a single database operation using Scene#updateEmbeddedDocuments.
Options which configure how multiple objects are rotated
A target angle of rotation (in degrees) where zero faces "south"
An incremental angle of rotation (in degrees)
Snap the resulting angle to a multiple of some increment (in degrees)
An Array of object IDs to target for rotation
Rotate objects whose documents are locked?
An array of objects which were rotated
An error if an explicitly provided id is not valid
Simultaneously move multiple PlaceableObjects via keyboard movement offsets. This executes a single database operation using Scene#updateEmbeddedDocuments.
Options which configure how multiple objects are moved
Horizontal movement direction
Vertical movement direction
Rotate the placeable to direction instead of moving
An Array of object IDs to target for movement. The default is the IDs of controlled objects.
Move objects whose documents are locked?
An array of objects which were moved during the operation
An error if an explicitly provided id is not valid
A helper method to prompt for deletion of all PlaceableObject instances within the Scene Renders a confirmation dialogue to confirm with the requester that all objects will be deleted
An array of Document objects which were deleted by the operation
Copy currently controlled PlaceableObjects to a temporary Array, ready to paste back into the scene later
The Array of copied PlaceableObject instances
Paste currently copied PlaceableObjects back to the layer by creating new copies
The destination position for the copied data.
Optional
options: { Options which modify the paste operation
Paste data in a hidden state, if applicable. Default is false.
Snap the resulting objects to the grid. Default is true.
An Array of created Document instances
Select all PlaceableObject instances which fall within a coordinate rectangle.
Optional
options: { The top-left x-coordinate of the selection rectangle.
The top-left y-coordinate of the selection rectangle.
The width of the selection rectangle.
The height of the selection rectangle.
Optional arguments provided to any called release() method.
Optional arguments provided to any called control() method.
Optional
aoptions: { Additional options to configure selection behaviour.
Whether to release other selected objects.
A boolean for whether the controlled set was changed in the operation.
Update all objects in this layer with a provided transformation. Conditionally filter to only apply to objects which match a certain condition.
An object of data or function to apply to all matched objects
A function which tests whether to target each object
Optional
options: object = {}Additional options passed to Document.update
An array of updated data once the operation is complete
Internal
Create a preview of this layer's object type from a world document and show its sheet to be finalized.
The data to create the object with.
Optional
options: { Options which configure preview creation
Render the preview object config sheet?
The offset-top position where the sheet should be rendered
The offset-left position where the sheet should be rendered
The created preview object
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
_getProtected
_canvasProtected
Get the world-transformed drop position.
Optional
options: { Return the coordinates of the center of the nearest grid element.
Returns the transformed x, y coordinates, or false if the drag event was outside the canvas.
Protected
_onPrivate
_getPrivate
_animatePrivate
_on
The Tokens Container.