The Tokens Container.
Token objects on this layer utilize the TokenHUD
An Array of tokens which belong to actors which are owned
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.
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.
Obtain a reference to the PlaceableObject class definition which represents the Document type in this layer.
Return a reference to the active instance of this canvas layer
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
Additional options to configure targeting behaviour.
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
Add or remove the set of currently controlled Tokens from the active combat encounter
The desired combat state which determines if each Token is added (true) or removed (false)
A Combat encounter from which to add or remove the Token
A specific Token which is the origin of the group toggle request
The Combatants added or removed
Immediately conclude the animation of any/all tokens
Record a new CRUD event in the history log so that it can be undone later
The event type (create, update, delete)
The object data
Reset canvas and tokens mouse manager.
Iterates over placeable objects that are eligible for control/select.
Obtain an iterable of objects which should be added to this PlaceableLayer
Draw a single placeable object
The Document instance used to create the placeable object
Override the default PIXI.Container behavior for how objects in this container are sorted.
Clear the contents of the preview container, restoring visibility of original (non-preview) objects.
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
Release all controlled PlaceableObject instance from this layer.
Options passed to the release method of each object
The number of PlaceableObject instances which were released
Simultaneously rotate multiple PlaceableObjects using a provided angle or incremental. This executes a single database operation using Scene.update. If rotating only a single object, it is better to use the PlaceableObject.rotate instance method.
Options which configure how multiple objects are rotated
An array of objects which were rotated
Simultaneously move multiple PlaceableObjects via keyboard movement offsets. This executes a single database operation using Scene.update. If moving only a single object, this will delegate to PlaceableObject.update for performance reasons.
Options which configure how multiple objects are moved
An array of objects which were moved during the operation
Undo a change to the objects in this layer This method is typically activated using CTRL+Z while the layer is active
An array of documents which were modified by the undo operation
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.
Options which modify the paste operation
An Array of created Document instances
Select all PlaceableObject instances which fall within a coordinate rectangle.
Additional options to configure selection behaviour.
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
An array of updated data once the operation is complete
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.
Options which configure preview creation
The created preview object
Activate the InteractionLayer, deactivating other layers and marking this layer's children as interactive.
Options which configure layer activation
The layer instance, now activated
Deactivate the InteractionLayer, removing interactivity from its children.
The layer instance, now inactive
Get the zIndex that should be used for ordering this layer vertically relative to others in the same Container.
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.
Deconstruct data used in the current layer in preparation to re-draw the canvas
Provide an array of Tokens which are eligible subjects for overhead tile occlusion. By default, only tokens which are currently controlled or owned by a player are included as subjects.
Get the world-transformed drop position.
Returns the transformed x, y co-ordinates, or false if the drag event was outside the canvas.
Handle double left-click events which originate from the Canvas stage.
The PIXI InteractionEvent which wraps a PointerEvent
Get the tab cycle order for tokens by sorting observable tokens based on their distance from top-left.
Animate targeting arrows on targeted tokens.
Handle dropping of Actor data onto the Scene canvas
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.
The current index position in the tab cycle
A reference to the named Document type which is contained within this Canvas Layer.
Creation states affected to placeables during their construction.