Register

Token Ease

An Add-on Module for Foundry Virtual Tabletop

Author: Wasp Project Source: Project URL Versions 11 - 12 (Verified 12) Last Updated 6 months, 3 weeks ago

Token Ease

This module extends native Foundry behavior to introduce easing, custom movement speed, and movement duration to tokens.

No more will you suffer the lethargic slog of transporting tokens across the canvas!

 

Module Settings

In the module settings, you can set the following options:

Token Movement Speed

Default: 6

This sets the default animation speed of moving tokens, in spaces per second (6 is Foundry default).

 

Token Movement Duration

Default: 0

This sets the default animation duration for token movement (in milliseconds).

This overrides Token Movement Speed, and causes tokens to reach their destination in a set amount of time, regardless of distance.

 

Token Movement Ease

Default: Linear

This sets the type of ease used by the movement animation on tokens.

 

Ease In/Out

Default: In & Out

This sets the type of easing to use at the start/end of the animation. If Token Movement Ease is set to Linear, this has no impact.

 

Play animation on keypad movement

Default: False

If enabled, this will make moving tokens with the movement keys (arrow keys, etc) to play the animations configured above.

We do not recommend enabling this, as the movement distance is so short when using movement keys.

 

API

token.document.update

As of Foundry v10, this natively accepts an additional optional parameter in its second parameter called `animation`:

token.document.update({

     x: ..., y: ...

}, {animate: true, animation: { speed: 6, duration: 0, ease: "linear" }})

Param Type Default
speed number 6
duration number 0
ease string linear

If speed or duration is given in the animation parameter, it will override the settings (see module settings above).

If duration is provided, speed has no impact on the animation, as the token will reach the destination within the given duration.

If you change easing, it is recommended you use the ones below.

 

CanvasAnimation Interface

Token Ease adds multiple easing functions to Foundry's CanvasAnimation interface:

Categories

Available Versions

  1. Version 1.3.0

    6 months, 3 weeks ago
    Foundry Version 11 - 12 (Verified 12) Manifest URL Read Notes
  2. Version 1.2.1

    2 years, 1 month ago
    Foundry Version 10+ (Verified 10) Manifest URL Read Notes
  3. Version 1.1.1

    Foundry Version 9.000+ (Verified 9.000) Manifest URL Read Notes
  4. Version 1.0.3

    Foundry Version 0.8.6+ (Verified 0.8.9) Manifest URL Read Notes