This Canvas Layer provides a container for AmbientSound objects.
Track whether to actively preview ambient sounds with mouse cursor movements
A mapping of ambient audio sources which are active within the rendered Scene
Placeable Layer Objects
Preview Object Placement
Keep track of history so that CTRL+Z can undo changes
Track whether "highlight all objects" is currently active
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.
Options for this layer instance.
A reference to the named Document type which is contained within this Canvas Layer.
Creation states affected to placeables during their construction.
Obtain a reference to the Collection of embedded Document instances within the currently viewed Scene
Return the precision relative to the Scene grid with which Placeable objects should be snapped
If objects on this PlaceableLayer have a HUD UI, provide a reference to its instance
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
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
Initialize all AmbientSound sources which are present on this layer
Update all AmbientSound effects in the layer by toggling their playback status. Sync audio for the positions of tokens which are capable of hearing.
Preview ambient audio for a given mouse cursor position
The cursor position to preview
Terminate playback of all ambient audio sources
Actions to take when the darkness level of the Scene is changed
The new darkness level
The prior darkness level
Handle mouse cursor movements which may cause ambient audio previews to occur
The initiating mouse move interaction event
Handle PlaylistSound document drop data.
The drag drop event
The dropped transfer data.
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
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
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.
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
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
Get the world-transformed drop position.
Returns the transformed x, y co-ordinates, or false if the drag event was outside the canvas.
Create a preview of this layer's object type from a world document and show its sheet so it can be finalized.
The data to create the object with.
The position to render the sheet at.
Handle double left-click events which originate from the Canvas stage.
The PIXI InteractionEvent which wraps a PointerEvent
Sync the playing state and volume of all AmbientSound objects based on the position of listener points
Locations of listeners which have the capability to hear
Define the easing function used to map radial distance to volume. Uses cosine easing which graduates from volume 1 at distance 0 to volume 0 at distance 1
The target volume level