TokenLayer

TokenLayer

The Tokens Container

Constructor

new TokenLayer()

Source:

Members

(static) layerOptions

Source:

_lastWildcard :string

Source:

Remember the last drawn wildcard token image to avoid repetitions

Type:
  • string

hud

Source:

Token objects on this layer utilize the TokenHUD

ownedTokens :Array.<Token>

Source:

An Array of tokens which belong to actors which are owned

Type:

Methods

activate()

Source:

concludeAnimation()

Source:

Immediately conclude the animation of any/all tokens

controlAll()

Source:

cycleTokens(forwards, reset) → {Token|null}

Source:

Cycle the controlled token by rotating through the list of Owned Tokens that are available within the Scene Tokens are currently sorted in order of their TokenID

Parameters:
Name Type Description
forwards boolean

Which direction to cycle. A truthy value cycles forward, while a false value cycles backwards.

reset boolean

Restart the cycle order back at the beginning?

Returns:

The Token object which was cycled to, or null

Type
Token | null

deactivate()

Source:

initialize()

Source:

Initialize the TokenLayer by preparing all Token sources which appear in the Scene.

releaseAll()

Source:

selectObjects()

Source:

targetObjects(x, y, width, height, releaseOthers) → {number}

Source:

Target all Token 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

releaseOthers boolean

Whether or not to release other targeted tokens

Returns:

The number of Token instances which were targeted.

Type
number

(async) tearDown()

Source:

(async) toggleCombat(state, combat, tokenopt) → {Promise.<Combat>}

Source:

Add or remove the set of currently controlled Tokens from the active combat encounter

Parameters:
Name Type Attributes Default Description
state boolean true

The desired combat state which determines if each Token is added (true) or removed (false)

combat Combat | null null

A Combat encounter from which to add or remove the Token

token Token | null <optional>

A specific Token which is the origin of the group toggle request

Returns:

The updated Combat encounter

Type
Promise.<Combat>