interface TokenAnimationOptions {
    action?: string;
    chain?: boolean;
    duration?: number;
    easing?: CanvasAnimationEasingFunction;
    movementSpeed?: number;
    name?: null | string | symbol;
    ontick?: (
        elapsedMS: number,
        animation: CanvasAnimationData,
        data: TokenAnimationData,
    ) => void;
    terrain?: null | DataModel<object, DataModelConstructionContext>;
    transition?: TokenAnimationTransition;
}

Properties

action?: string

The movement action. Default: this.document.movementAction.

chain?: boolean

Chain the animation to the existing one of the same name? Default: false.

duration?: number

The duration of the animation in milliseconds (nonnegative). Default: automatic (determined by foundry.canvas.placeables.Token#_getAnimationDuration, which returns 1000 by default unless it's a movement animation).

The easing function of the animation. Default: undefined (linear).

movementSpeed?: number

A desired base movement speed in grid size per second (positive), which determines the duration if the given duration is undefined and either x, y, width, height, or rotation is animated. Default: automatic (determined by foundry.canvas.placeables.Token#_getAnimationMovementSpeed).

name?: null | string | symbol

The name of the animation, or null if nameless. Default: foundry.canvas.placeables.Token#animationName.

ontick?: (
    elapsedMS: number,
    animation: CanvasAnimationData,
    data: TokenAnimationData,
) => void

An on-tick callback.

terrain?: null | DataModel<object, DataModelConstructionContext>

The terrain data. Default: null.

The desired texture transition type. Default: automatic (determined by foundry.canvas.placeables.Token#_getAnimationTransition, which returns "fade" by default).