The Walls Layer

The Grid Layer is positioned 2nd from bottom in the layers of the Canvas. The Grid Layer is responsible for orienting and segmenting the game space into grid spaces. Currently only a square grid is supported but hex grid support is flagged as a feature for work during Beta development.

The Grid provides convenience tools for measuring distance, restricting token movement, and providing guide lines for anchoring wall segments or other canvas features.

Wall Configuration

Walls are customized by the Game Master from within the application. To add or modify walls on the Walls Layer activate the Wall Layer on the primary toolbar as a player with Game Master privileges. There are four varietes of wall segments which can be placed into a scene:

Regular Walls
These walls block both movement and vision. They are rendered on the Walls Layer using an off-white color.
Invisible Walls
These walls block movement, but not vision. They are rendered on the Walls Layer using a light blue color.
Doors
These walls are able to be toggled between multiple states. Doors may be closed, open, or locked. Closed (or locked) doors block both movement and vision, while open doors do not block either vision or movement. Doors will be rendered as a small icon for player views which, if clicked, will open or close the door provided it is not locked. Only Game-Master players have the ability to unlock doors. Open doors are rendered in green while with closed doors in orange and locked doors in red.
Secrets
These walls work as doors, able to be toggled between closed, open, or locked states, however unlike regular doors the icon for secret doors is not shown to players and these can only be toggled by the Game Master. Secret doors are rendered in purple.
../../../_images/walls-doors.jpg

In the above image (from the GM perspective), Daulgrim the Dwarf Ranger is exploring a small room. The white lines around the exterior of the room are regular walls, the fountain is surrounded by invisible walls which prevent the player from moving into the fountain area. There is a closed door to the right is not locked and could be opened by the player.

Walls Layer API

Mod developers may wish to interact with or manipulate this layer and can do so using the singleton instance of the WallsLayer() class which is accessible from within the client as canvas.walls.

class WallsLayer()

The Walls Layer Container which extends PlaceablesLayer to provide a layer of the primary game canvas

WallsLayer.activate()

Override the activation behavior of the PlaceablesLayer. While active, ambient sound previews are displayed.

WallsLayer.blockMovement

type: Array

An Array of Wall() intances on the current Scene which block token movement. Movement-blocking walls include:

  1. Regular Walls
  2. Invisible Walls
  3. Closed Doors
WallsLayer.blockVision

type: Array

An Array of Wall() intances on the current Scene which block token vision. Vision-blocking walls include:

  1. Regular Walls
  2. Closed Doors
WallsLayer.chain

type: PIXI.Graphics

A graphics layer used to display chained Wall selection

WallsLayer.checkCollision(ray)

Check whether movement along a given Ray collides with a Wall

Arguments:
  • ray (Ray) – The attempted movement
Returns:

Boolean – Does a collision occur?

WallsLayer.dataArray

type: Array

Define the source data array underlying the placeable objects contained in this layer

WallsLayer.deactivate()

Override the deactivation behavior of the PlaceablesLayer. When inactive, ambient sound previews are hidden from view.

WallsLayer.doors

type: Array

An Array of Wall instances in the current Scene which act as Doors

WallsLayer.draw()

Draw the WallsLayer, placing each wall exists in the scene Draw each Wall within the scene as a child of the objects container

WallsLayer.endpoints

type: Array

The set of unique vision-blocking wall endpoints Used to shortcut calculation of line-of-sight

WallsLayer.gridPrecision

type: Number

Gate the precision of wall snapping to become less precise for small scale maps

WallsLayer.highlightControlledSegments()

Highlight the endpoints of Wall segments which are currently group-controlled on the Walls layer

WallsLayer.layerOptions

Customize behaviors of the TilesLayer by modifying some behaviors at a class level

WallsLayer.pasteObjects(position, options)

The Walls layer require some special Paste logic to adjust all 4 wall coordinates instead of just {x,y}

Returns:Promise.<Array> – An Array of created Objects
WallsLayer.placeableClass

type: PIXI.Container

Define a Container implementation used to render placeable objects contained in this layer

WallsLayer.walls

type: PIXI.Container

The Walls Container - just references objects array for backwards compatibility