Foundry Virtual Tabletop - API Documentation - Version 14
    Preparing search index...

    Interface TokenAnimationOptions

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

    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?: string | symbol | null

    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.

    speedMultiplier?: number

    The movement speed multiplier to apply to the base movement speed. Default: 1.

    terrain?: DataModel<object, DataModelConstructionContext> | null

    The terrain data. Default: null.

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