Synthetic Wall instances which represent the outer boundaries of the game canvas.
Synthetic Wall instances which represent the inner boundaries of the scene rectangle.
A graphics layer used to display chained Wall selection
Track whether we are currently within a chained placement workflow
Track whether the layer is currently toggled to snap at exact grid precision
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.
Track the most recently created or updated wall data for use with the clone tool
Reference the last interacted wall endpoint for the purposes of chaining
A reference to the named Document type which is contained within this Canvas Layer.
Creation states affected to placeables during their construction.
An Array of Wall instances in the current Scene which act as Doors.
Gate the precision of wall snapping to become less precise for small scale maps.
Obtain a reference to the Collection of embedded Document instances within the currently viewed Scene
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.
Track the PlaceableObject on this layer which is currently hovered upon.
Track the PlaceableObject on this layer which is currently hovered upon.
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
Perform initialization steps for the WallsLayer whenever the composition of walls in the Scene is changed. Cache unique wall endpoints and identify interior walls using overhead roof tiles.
Initialization to identify all intersections between walls. These intersections are cached and used later when computing point source polygons.
Identify walls which are treated as "interior" because they are contained fully within a roof tile.
Test whether movement along a given Ray collides with a Wall.
The attempted movement
Highlight the endpoints of Wall segments which are currently group-controlled on the Walls layer
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
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
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
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
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
Define the canvas boundaries for outer and inner regions
Pan the canvas view when the cursor position gets close to the edge of the frame
The originating mouse movement event
The x-coordinate
The y-coordinate
Get the endpoint coordinates for a wall placement, snapping to grid at a specified precision Require snap-to-grid until a redesign of the wall chaining system can occur.
The initial candidate point
Whether to snap to grid
The endpoint coordinates [x,y]
The Scene Controls tools provide several different types of prototypical Walls to choose from This method helps to translate each tool into a default wall data configuration for that type
The active canvas tool
Given a point and the coordinates of a wall, determine which endpoint is closer to the point
The origin point of the new Wall placement
The existing Wall object being chained to
The [x,y] coordinates of the starting endpoint
The Walls canvas layer which provides a container for Wall objects within the rendered Scene.