Defines the filter to use for detection.
A Graphics instance which renders the border frame for this Token inside the GridLayer.
Track the set of User documents which are currently targeting this Token
A reference to the SpriteMesh which displays this Token in the PrimaryCanvasGroup.
A reference to the VisionSource object which defines this vision source area of effect
A reference to the LightSource object which defines this light source area of effect
A reference to an animation that is currently in progress for this Token, if any
Retain a reference to the Scene within which this Placeable Object resides
A reference to the Scene embedded Document instance which this object represents
A control icon for interacting with the object
A mouse interaction manager instance which handles mouse workflows related to this object.
Passthrough certain drag operations on locked objects.
Know if a placeable is in the hover-in state.
An Object which records the Token's prior velocity dx and dy. This can be used to determine which direction a Token was previously moving.
The Token central coordinate, adjusted for its most recent movement vector.
The Token's most recent valid position and rotation.
A flag to capture whether this Token has an unlinked video texture
The bounds that the placeable was added to the quadtree with.
Has this placeable been drawn yet?
Identify the official Document name for this PlaceableObject class
A convenient reference to the Actor object associated with the Token embedded document.
A convenient reference for whether the current User has full control over the Token document.
A boolean flag for whether the current game User has observer permission for the Token
Is the HUD display active for this token?
Convenience access to the token's nameplate string
Translate the token's grid width into a pixel width based on the canvas size
Translate the token's grid height into a pixel height based on the canvas size
The Token's current central position
The HTML source element for the primary Tile texture
Does this Tile depict an animated video texture?
An indicator for whether or not this token is currently involved in the active combat encounter.
Return a reference to a Combatant that represents this Token, if one is present in the current encounter.
An indicator for whether the Token is currently targeted by the active game User
Return a reference to the detection modes array.
Determine whether the Token is visible to the calling user's perspective. Hidden Tokens are only displayed to GM Users. Non-hidden Tokens are always visible if Token Vision is not required. Controlled tokens are always visible. All Tokens are visible to a GM user if no Token is controlled.
The animation name used for Token movement
Test whether the Token has sight (or blindness) at any radius
Does this Token actively emit light given its properties and the current darkness level of the Scene?
Test whether the Token uses a limited angle of vision or light emission.
Translate the token's dim light distance in units into a radius in pixels.
Translate the token's bright light distance in units into a radius in pixels.
Translate the token's vision range in units into a radius in pixels.
Translate the token's maximum vision range that takes into account lights.
The external radius of the token in pixels.
The mouse interaction state of this placeable.
The id of the corresponding Document which this PlaceableObject represents.
A unique identifier which is used to uniquely identify elements on the canvas related to this object.
Is this placeable object a temporary preview?
Does there exist a temporary preview of this placeable object?
The field-of-vision polygon for the object, if it has been computed
Provide a reference to the CanvasLayer which contains this PlaceableObject.
The line-of-sight polygon for the object, if it has been computed
A Form Application which is used to configure the properties of this Placeable Object or the Document it represents.
An indicator for whether the object is currently controlled
An indicator for whether the object is currently a hover target
An indicator for whether the object is currently a hover target
The Token's central position, adjusted in each direction by one or zero pixels to offset it relative to walls.
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.
A new object with identical data
Update the light and vision source objects associated with this Token.
Options which configure how perception sources are updated
Update an emitted light source associated with this Token.
Update the VisionSource instance associated with this Token.
Options which affect how the vision source is updated
The inner _destroy method which may optionally be defined by each PlaceableObject subclass.
Refresh the display of Token attribute bars, rendering its latest resource data. If the bar attribute is valid (has a value and max), draw the bar. Otherwise hide it.
Draw the active effects and overlay effect icons which are present upon the Token
Animate changes to the appearance of the Token. Animations are performed over differences between the TokenDocument and the current Token and TokenMesh appearance.
A record of the differential data which changed, for reference only
Options which configure the animation behavior
A promise which resolves once the animation is complete
Terminate animation of this particular Token.
Check for collision when attempting a move to a new position
The central destination point of the attempted movement
Additional options forwarded to WallsLayer#checkCollision
The result of the WallsLayer#checkCollision test
Get the center-point coordinate for a given grid position
The grid x-coordinate that represents the top-left of the Token
The grid y-coordinate that represents the top-left of the Token
The coordinate pair which represents the Token's center at position (x, y)
Set this Token as an active target for the current game User. Note: If the context is set with groupSelection:true, you need to manually broadcast the activity for other users.
Is the Token now targeted?
Additional context options
Toggle an active effect by its texture path. Copy the existing Array in order to ensure the update method detects the data as changed.
The texture file-path of the effect icon to toggle on the Token.
Additional optional arguments which configure how the effect is handled.
Was the texture applied (true) or removed (false)
Toggle the visibility state of any Tokens in the currently selected set
A Promise which resolves to the updated Token documents
A generic transformation to turn a certain number of grid units into a radius in canvas pixels. This function adds additional padding to the light radius equal to the external radius of the token. This causes light to be measured from the outer token edge, rather than from the center-point.
The radius in grid units
The radius in pixels
Handle changes to Token behavior when a significant status effect is applied
The status effect ID being applied, from CONFIG.specialStatusEffects
Is the special status effect now active?
Additional events which trigger once control of the object is established
Optional parameters which apply for specific implementations
Additional events which trigger once control of the object is released
Options which modify the releasing workflow
Actions that should be taken for this Placeable Object when a mouseover event occurs. Hover events on PlaceableObject instances allow event propagation by default.
The triggering canvas interaction event
Options which customize event handling
True if the event was handled, otherwise false
Actions that should be taken for this Placeable Object when a mouseout event occurs
The triggering canvas interaction event
True if the event was handled, otherwise false
Callback actions which occur on a single left-click event to assume control of the object
The triggering canvas interaction event
Draw the placeable object into its parent container
The drawn object
Refresh all incremental render flags for the PlaceableObject. This method is no longer used by the core software but provided for backwards compatibility.
The refreshed object
Update the quadtree.
Assume control over a PlaceableObject, flagging it as controlled and enabling downstream behaviors
Additional options which modify the control request
Release any other controlled objects first
A flag denoting whether control was successful
Release control over a PlaceableObject, removing it from the controlled set
Options which modify the releasing workflow
A Boolean flag confirming the object was released.
Rotate the PlaceableObject to a certain angle of facing
The desired angle of rotation
Snap the angle of rotation to a certain target degree increment
The rotated object
Determine a new angle of rotation for a PlaceableObject either from an explicit angle or from a delta offset.
An object which defines the rotation update parameters
The new rotation angle for the object
Activate interactivity for the Placeable Object
Test whether a user can perform a certain interaction regarding a Placeable Object
The User performing the action
The named action being attempted
Does the User have rights to perform the action?
Test whether this Token is a viable vision source for the current User
Render the bound mesh detection filter. Note: this method does not verify that the detection filter exists.
Refresh the visibility.
Refresh the text content, position, and visibility of the Token nameplate.
Refresh the token mesh.
Refresh the token mesh shader.
Draw the Token border, taking into consideration the grid type and border color
Get the hex color that should be used to render the Token border
The hex color used to depict the border color
Refresh the target indicators for the Token. Draw both target arrows for the primary User and indicator pips for other Users targeting the same Token.
Draw the targeting arrows around this token.
Additional parameters to configure how the targeting reticule is drawn.
Draw a single resource bar, given provided data
The Bar number
The Bar container
Resource data for this bar
Return the text which should be displayed in a token's tooltip field
Get the text style that should be used for this Token's tooltip.
Draw a status effect icon
Draw the overlay effect icon
Refresh the display of status effects, adjusting their position for the token width and height.
Helper method to determine whether a token attribute is viewable under a certain mode
The mode from CONST.TOKEN_DISPLAY_MODES
Is the attribute viewable?
Get the target opacity that should be used for a Placeable Object depending on its preview state.
Create a standard MouseInteractionManager for the PlaceableObject
Does the User have permission to create the underlying Document?
The User performing the action.
The event object.
The returned status.
Does the User have permission to update the underlying Document?
The User performing the action.
The event object.
The returned status.
Does the User have permission to delete the underlying Document?
The User performing the action.
The event object.
The returned status.
Should the placeable propagate right click downstream?
Callback actions which occur on a single right-click event to configure properties of the object
The triggering canvas interaction event
Begin a drag operation from the perspective of the preview clone. Modify the appearance of both the clone (this) and the original (_original) object.
Callback action which occurs on a long press.
The triggering canvas interaction event
The local canvas coordinates of the mousepress.
Establish an initial velocity of the token based on its direction of facing. Assume the Token made some prior movement towards the direction that it is currently facing.
Apply initial sanitizations to the provided input data to ensure that a Token has valid required attributes. Constrain the Token position to remain within the Canvas rectangle.
Draw resource bars for the Token
Refresh aspects of the user interaction state. For example the border, nameplate, or bars may be shown on Hover or on Control.
Handle changes to the width or height of the Token base.
Refresh position of the Token. Called when x/y coordinates change.
Refresh elevation of the Token. Called when its elevation or sort attributes change.
Draw the token's nameplate as a text object
The Text object for the Token nameplate
Draw a text tooltip for the token which can be used to display Elevation or a resource value
The text object used to render the tooltip
Handle a single frame of a token animation.
The current animation frame
The animation configuration
Prepare a MovementSource for the document
A helper function to toggle the overlay status icon on the Token
When Token position or rotation changes, record the movement vector. Update cached values for both #validPosition and #priorMovement.
Did the x/y position change?
Did rotation change?
Did the width or height change?
Automatically pan the canvas when a controlled Token moves offscreen.
Force the release of the hover state for this token.
Check the position of the mouse and assign hover to the token if the mouse is inside the bounds.
A Token is an implementation of PlaceableObject which represents an Actor within a viewed Scene on the game canvas.
{TokenDocument}
{TokenLayer}