PlaceableObject

PlaceableObject

A PlaceableObject base container class

Constructor

new PlaceableObject()

Source:

Members

(static) layer :PlaceablesLayer

Source:

Provide a reference to the canvas layer which contains placeable objects of this type

Type:

center :Object

Source:

The central coordinate pair of the placeable object based on it's own width and height

Type:
  • Object

controlIcon :ControlIcon

Source:

A control icon for interacting with the object

Type:

coords :Array

Source:

The [x,y] coordinates of the placeable object within the Scene container

Type:

data :Object

Source:

The underlying data object which provides the basis for this placeable object

Type:
  • Object

fov :PIXI.Polygon

Source:

Track the field of vision for the placeable object. This is necessary to determine whether a player has line-of-sight towards a placeable object or vice-versa

Type:
  • PIXI.Polygon

id :string

Source:

The EmbeddedDocument id of the underlying data object

Type:
  • string

layer :PlaceablesLayer

Source:

Return a reference to the singleton layer instance which contains placeables of this type

Type:

owner :Boolean

Source:

A Boolean flag for whether the current game User has permission to control this token

Type:
  • Boolean

scene :Scene

Source:

Retain a reference to the Scene within which this Placeable Object resides

Type:

sheet :Application

Source:

A placeable object should define the logic to create

Type:

uuid :string

Source:

A Universally Unique Identifier (uuid) for this Embedded Entity instance

Type:
  • string

Methods

(async, static) create()

Source:

clear()

Source:

Clear the display of the existing object

clone() → {PlaceableObject}

Source:

Clone the placeable object, returning a new object with identical attributes The returned object is non-interactive, and has no assigned ID If you plan to use it permanently you should call the create method

Returns:

A new object with identical data

Type
PlaceableObject

control(options) → {boolean}

Source:

Assume control over a PlaceableObject, flagging it as controlled and enabling downstream behaviors

Parameters:
Name Type Description
options Object

Additional options which modify the control request

Properties
Name Type Description
releaseOthers boolean

Release any other controlled objects first

Returns:

A flag denoting whether or not control was successful

Type
boolean

(async) delete()

Source:

displayToFront()

Source:

Shift the display of the PlaceableObject to the top of the rendering stack, above all other siblings

draw() → {PlaceableObject}

Source:

Draw the placeable object into its parent container

Returns:

A reference to the drawn object

Type
PlaceableObject

getFlag(scope, key) → {*}

Source:

Get the value of a "flag" for this PlaceableObject See the setFlag method for more details on flags

Parameters:
Name Type Description
scope String

The flag scope which namespaces the key

key String

The flag key

Returns:

The flag value

Type
*

refresh() → {PlaceableObject}

Source:

Refresh the visual representation of the Placeable Object

Returns:

A reference to the refreshed object

Type
PlaceableObject

release(options) → {Boolean}

Source:

Release control over a PlaceableObject, removing it from the controlled set

Parameters:
Name Type Description
options Object

Options which modify the releasing workflow

Returns:

A Boolean flag confirming the object was released.

Type
Boolean

(async) rotate(angle, snap) → {Promise}

Source:

Rotate the PlaceableObject to a certain angle of facing

Parameters:
Name Type Description
angle number

The desired angle of rotation

snap number

Snap the angle of rotation to a certain target degree increment

Returns:

A Promise which resolves once the rotation has completed

Type
Promise

(async) setFlag(scope, key, value) → {Promise}

Source:

Assign a "flag" to this Entity. Flags represent key-value type data which can be used to store flexible or arbitrary data required by either the core software, game systems, or user-created modules.

Each flag should be set using a scope which provides a namespace for the flag to help prevent collisions.

Flags set by the core software use the "core" scope. Flags set by game systems or modules should use the canonical name attribute for the module Flags set by an individual world should "world" as the scope.

Flag values can assume almost any data type. Setting a flag value to null will delete that flag.

Parameters:
Name Type Description
scope String

The flag scope which namespaces the key

key String

The flag key

value *

The flag value

Returns:

A Promise resolving to the updated PlaceableObject

Type
Promise

sortToBack()

Source:

Sort the PlaceableObject to the back of the rendering stack, behind all other siblings. Update the database with the new minimal Z-index

sortToFront()

Source:

Sort the PlaceableObject to the front of the rendering stack, above all other siblings. Update the database with the new maximal Z-index

(async) unsetFlag(scope, key) → {Promise}

Source:

Remove a flag assigned to the Entity

Parameters:
Name Type Description
scope string

The flag scope which namespaces the key

key string

The flag key

Returns:

A Promise resolving to the updated Entity

Type
Promise

(async) update()

Source: