TilesLayer

TilesLayer

The Tiles canvas layer which provides a container for Tile objects which are rendered immediately above the BackgroundLayer and below the GridLayer.

Constructor

new TilesLayer()

Source:
See:

Extends

Members

(static) dataArray

Source:

(static) layerOptions

Source:

(static) placeableClass

Source:

_controlled :Object

Source:
Inherited From:

Track the set of PlaceableObjects on this layer which are currently controlled by their id

Type:
  • Object

_copy :Array

Source:
Inherited From:

Keep track of an object copied with CTRL+C which can be pasted later

Type:

_hover :PlaceableObject

Source:
Inherited From:

Track the PlaceableObject on this layer which is currently being hovered upon

Type:

controlled

Source:
Inherited From:

An Array of placeable objects in this layer which have the _controlled attribute

gridPrecision

Source:
Inherited From:

Return the precision relative to the Scene grid with which Placeable objects should be snapped

history :Array

Source:
Inherited From:

Keep track of history so that CTRL+Z can undo changes

Type:

hud :TileHUD

Source:
Overrides:

Tile objects on this layer utilize the TileHUD

Type:

objects :PIXI.Container

Source:
Inherited From:

Placeable Layer Objects

Type:
  • PIXI.Container

options :Object

Source:
Inherited From:

PlaceableObject layer options

Type:
  • Object

placeables :Array

Source:
Inherited From:

A convenience method for accessing the placeable object instances contained in this layer

Type:

preview

Source:
Inherited From:

Preview Object Placement

Methods

activate()

Source:
Inherited From:

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

copyObjects() → {Array}

Source:
Inherited From:

Copy currently controlled PlaceableObjects to a temporary Array, ready to paste back into the scene later

Returns:

The Array of copied Objects

Type
Array

(async) createMany(data, options) → {Promise}

Source:
Inherited From:

Create multiple embedded entities in a parent Entity collection using an Array of provided data

Parameters:
Name Type Description
data Array

An Array of update data Objects which provide incremental data

options Object

Additional options which customize the update workflow

Returns:

A Promise which resolves to the returned socket response (if successful)

Type
Promise

createObject() → {PlaceableObject}

Source:
Inherited From:

Draw a single placeable object

Returns:
Type
PlaceableObject

deactivate()

Source:
Overrides:

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

deleteAll()

Source:
Inherited From:

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

(async) deleteMany(ids, options) → {Promise}

Source:
Inherited From:

Simultaneously delete multiple PlaceableObjects. This executes a single database operation using Scene.update. If deleting only a single object, this will delegate to PlaceableObject.delete for performance reasons.

Parameters:
Name Type Description
ids Array

An Array of object IDs to target for deletion

options Object

Additional options which customize the update workflow

Returns:

A Promise which resolves to the returned socket response (if successful)

Type
Promise

(async) draw()

Source:
Inherited From:

Draw the PlaceablesLayer. Draw each Sound within the scene as a child of the sounds container.

get(objectId) → {PlaceableObject}

Source:
Inherited From:

Get a PlaceableObject contained in this layer by it's ID

Parameters:
Name Type Description
objectId string

The ID of the contained object to retrieve

Returns:

The object instance, or undefined

Type
PlaceableObject

(async) moveMany(dx, dy, rotate, ids) → {Promise}

Source:
Inherited From:

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.

Parameters:
Name Type Description
dx Number

The number of incremental grid units in the horizontal direction

dy Number

The number of incremental grid units in the vertical direction

rotate Boolean

Rotate the token to the keyboard direction instead of moving

ids Array | Set

An Array or Set of object IDs to target for rotation

Returns:

The resulting Promise from the Scene.update operation

Type
Promise

(async) pasteObjects() → {Promise.<Array>}

Source:
Inherited From:

Paste currently copied PlaceableObjects back to the layer by creating new copies

Returns:

An Array of created Objects

Type
Promise.<Array>

releaseAll(options) → {Number}

Source:
Inherited From:

Release all controlled PlaceableObject instance from this layer.

Parameters:
Name Type Description
options Object

Additional options which customize the Object releasing behavior

Returns:

The number of PlaceableObject instances which were released

Type
Number

(async) rotateMany(angle, delta, snap, ids) → {Promise}

Source:
Inherited From:

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.

Parameters:
Name Type Description
angle Number

A target angle of rotation (in degrees) where zero faces "south"

delta Number

An incremental angle of rotation (in degrees)

snap Number

Snap the resulting angle to a multiple of some increment (in degrees)

ids Array | Set

An Array or Set of object IDs to target for rotation

Returns:

The resulting Promise from the Scene.update operation

Type
Promise

selectObjects(x, y, width, height, releaseOptions, controlOptions) → {Number}

Source:
Inherited From:

Select all PlaceableObject instances which fall within a coordinate rectangle.

Parameters:
Name Type Description
x Number

The top-left x-coordinate of the selection rectangle

y Number

The top-left y-coordinate of the selection rectangle

width Number

The width of the selection rectangle

height Number

The height of the selection rectangle

releaseOptions Object

Optional arguments provided to any called release() method

controlOptions Object

Optional arguments provided to any called control() method

Returns:

The number of PlaceableObject instances which were controlled.

Type
Number

sortObjects()

Source:
Inherited From:

Reorder the child objects of the layer according to their z-index (if one exists)

(async) undoHistory() → {Promise}

Source:
Inherited From:

Undo a change to the objects in this layer This method is typically activated using CTRL+Z while the layer is active

Returns:
Type
Promise

(async) updateMany(data, options) → {Promise}

Source:
Inherited From:

Update multiple embedded entities in a parent Entity collection using an Array of provided data

Parameters:
Name Type Description
data Array

An Array of update data Objects which provide incremental data

options Object

Additional options which customize the update workflow

Returns:

A Promise which resolves to the returned socket response (if successful)

Type
Promise