TokenData

data. TokenData

The data schema for a Token document.

Constructor

new TokenData(data, documentopt)

Properties:
Name Type Attributes Default Description
_id string

The Token _id which uniquely identifies it within its parent Scene

name string

The name used to describe the Token

displayName number <optional>
0

The display mode of the Token nameplate, from CONST.TOKEN_DISPLAY_MODES

actorId string | null

The _id of an Actor document which this Token represents

actorLink boolean <optional>
false

Does this Token uniquely represent a singular Actor, or is it one of many?

actorData object <optional>

Token-level data which overrides the base data of the associated Actor

img string

A file path to an image or video file used to depict the Token

tint string <optional>
null

An optional color tint applied to the Token image

width number <optional>
1

The width of the Token in grid units

height number <optional>
1

The height of the Token in grid units

scale number <optional>
1

A scale factor applied to the Token image, between 0.25 and 3

mirrorX boolean <optional>
false

Flip the Token image horizontally?

mirrorY boolean <optional>
false

Flip the Token image vertically?

x number <optional>
0

The x-coordinate of the top-left corner of the Token

y number <optional>
0

The y-coordinate of the top-left corner of the Token

elevation number <optional>
0

The vertical elevation of the Token, in distance units

lockRotation boolean <optional>
false

Prevent the Token image from visually rotating?

rotation number <optional>
0

The rotation of the Token in degrees, from 0 to 360. A value of 0 represents a southward-facing Token.

effects Array.<string> <optional>

An array of effect icon paths which are displayed on the Token

overlayEffect string <optional>

A single icon path which is displayed as an overlay on the Token

hidden boolean <optional>
false

Is the Token currently hidden from player view?

vision boolean <optional>

Is this Token a source of vision?

dimSight number <optional>
0

How far in distance units the Token can naturally see as if in dim light

brightSight number <optional>
0

How far in distance units the Token can naturally see as if in bright light

sightAngle number <optional>
360

The angle at which this Token is able to see, if it has vision

dimLight number <optional>
0

How far in distance units this Token emits dim light

brightLight number <optional>
0

How far in distance units this Token emits bright light

lightAngle number <optional>
360

The angle at which this Token is able to emit light

lightAnimation AnimationData <optional>

A data object which configures token light animation settings

disposition number <optional>
-1

A displayed Token disposition from CONST.TOKEN_DISPOSITIONS

displayBars number <optional>
0

The display mode of Token resource bars, from CONST.TOKEN_DISPLAY_MODES

bar1 data.TokenBarData <optional>

The configuration of the Token's primary resource bar

bar2 data.TokenBarData <optional>

The configuration of the Token's secondary resource bar

flags object <optional>
{}

An object of optional key/value flags

Parameters:
Name Type Attributes Description
data object

Initial data used to construct the data object

document BaseToken <optional>

The document to which this data object belongs

Extends

  • DocumentData

Members

DEFAULT_ICON :string

The default icon used for newly created Item documents

Type:
  • string

Methods

_initialize()