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

Source:

An Array of tokens which belong to actors which are owned

Type:

Methods

concludeAnimation()

Source:

Immediately conclude the animation of any/all tokens

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:

(async) dropActor(actor, tokenData)

Source:

Drop the Token representing an Actor on the canvas at a specific position

Parameters:
Name Type Description
actor Actor

The ID of the Actor whose token should be dropped

tokenData Object

An objet of additional Token data with which to override the Actor prototype

getDragDestination()

Source:

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: