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

    Interface ParticleGeneratorConfiguration

    interface ParticleGeneratorConfiguration {
        alpha?: ParticleGeneratorRange;
        anchor?: ParticleGeneratorAnchor;
        anchorOffset?: IPointData | null;
        anchorPoint?: ParticleGeneratorAnchorPoint;
        area?: ParticleGeneratorArea | null;
        behavior?: ParticleGeneratorBehavior | ParticleGeneratorBehaviorId | null;
        blend?: BLEND_MODES;
        blur?:
            | number
            | { intensity: number; quality?: number }
            | { enabled: boolean; intensity: number; quality?: number }
            | null;
        bounds?:
            | Rectangle
            | { height: number; width: number; x: number; y: number }
            | null;
        clip?: boolean | Rectangle | ParticleGeneratorClipOptions;
        constraintArea?: Rectangle | "world" | "view" | "budget" | null;
        constraintMode?: ParticleGeneratorConstraintMode | null;
        container?: Container<DisplayObject>;
        count?: number;
        debug?: boolean | ParticleGeneratorDebugOptions | null;
        drift?: { enabled: boolean; intensity: number };
        elevation?: number;
        fade?: ParticleGeneratorFadeOptions;
        follow?: ParticleGeneratorFollowOptions;
        initial?: number;
        lifetime?: ParticleGeneratorRange;
        manual?: boolean | null;
        mode?: ParticleGeneratorMode;
        newlyVisible?: boolean;
        onDeath?: Function | null;
        onSpawn?: Function | null;
        onTick?: Function | null;
        orbit?: ParticleGeneratorOrbitOptions;
        perFrame?: number;
        positionTest?: Function | null;
        probability?: number;
        randomizeAgeInPadding?: boolean;
        restitution?: number;
        rotationSpeed?: number;
        scale?: ParticleGeneratorRange;
        sort?: number;
        textures?: (string | Texture<Resource>)[];
        ticker?: Ticker;
        velocity?: ParticleGeneratorVelocityOptions | null;
        viewPadding?: number;
    }
    Index

    Properties

    The maximum alpha range for particles.

    An optional anchor used to attach areas and behaviors.

    anchorOffset?: IPointData | null

    A fixed offset (scene pixels) applied to the anchor.

    Which point to use when anchoring.

    area?: ParticleGeneratorArea | null

    The default spawn area in "effect" mode (scene coordinates).

    Optional behavior.

    blend?: BLEND_MODES

    The blend mode used to render particles.

    blur?:
        | number
        | { intensity: number; quality?: number }
        | { enabled: boolean; intensity: number; quality?: number }
        | null

    An optional blur filter applied to the internal container.

    bounds?:
        | Rectangle
        | { height: number; width: number; x: number; y: number }
        | null

    Optional generator bounds in scene coordinates. This is used for coordinate conversion, viewport clamping, and optional clipping. Defaults to the current Scene dimensions.

    clip?: boolean | Rectangle | ParticleGeneratorClipOptions

    Clip (=> mask) configuration. Use true for default clipping (bounds) or pass a rectangle.

    constraintArea?: Rectangle | "world" | "view" | "budget" | null

    The constraint area.

    • "budget": the padded viewport rectangle.
    • "view": the unpadded viewport rectangle.
    • "world": the generator bounds.
    • PIXI.Rectangle: a custom rectangle in scene coordinates. If null, defaults to "budget" in ambient mode when constraintMode is not "none".
    constraintMode?: ParticleGeneratorConstraintMode | null

    How to handle particles leaving the constraint area. If null, defaults to "kill" in ambient mode and "none" in effect mode.

    container?: Container<DisplayObject>

    The parent container which receives the internal particle container. Defaults to canvas.primary.

    count?: number

    The target particle count.

    • In "ambient" mode, this is the maximum for the full bounds and is scaled by visible area.
    • In "effect" mode, this is the absolute target.
    debug?: boolean | ParticleGeneratorDebugOptions | null

    Optional debugging helpers.

    drift?: { enabled: boolean; intensity: number }

    Optional random drift configuration.

    elevation?: number

    The elevation for the particle container.

    Fade envelope configuration.

    Follow behavior options.

    initial?: number

    The initial proportion (0..1) of the computed target particle count to spawn on start.

    The particle lifetime in milliseconds.

    manual?: boolean | null

    If true, particles are never spawned automatically. If null, defaults to true in "effect" mode and false in "ambient" mode.

    The runtime mode.

    • "ambient": maintains a stable density in the visible region (viewport-based budget).
    • "effect": spawns in a defined area; particles are lifetime-driven unless constrained.
    newlyVisible?: boolean

    If true, prioritize spawning particles in newly-visible areas when the view changes (pan/zoom).

    onDeath?: Function | null

    An optional callback called when a particle is recycled. The function receives (particle, {generator, reason}).

    onSpawn?: Function | null

    An optional callback called after the particle has been placed and configured. The function receives (particle, {generator}).

    onTick?: Function | null

    An optional callback called per frame (not per particle!) The function receives (dt, generator).

    Orbit behavior options.

    perFrame?: number

    The maximum number of particles that may be spawned per frame (auto-spawn mode).

    positionTest?: Function | null

    An optional spawn validator. The function is invoked as (x, y, {generator, particle}) and must return true if the location is valid. Coordinates are scene coordinates in pixels. The generator evaluates a single candidate position per spawn attempt.

    probability?: number

    The chance (0..1) that a spawn attempt actually creates a particle.

    randomizeAgeInPadding?: boolean

    If true, particles spawned in padded regions can start partially through their lifetime.

    restitution?: number

    Bounce restitution factor (0..1) used when constraintMode is "bounce".

    rotationSpeed?: number

    The rotation speed in degrees per second.

    The scale range for particles.

    sort?: number

    The sorting key for the particle container.

    textures?: (string | Texture<Resource>)[]

    The particle texture sources. Each entry may be a PIXI.Texture or a string path usable by foundry.canvas.getTexture/PIXI.Texture.from.

    ticker?: Ticker

    The ticker used to drive the update loop. Defaults to CanvasAnimation.ticker.

    The particle velocity in pixels per second.

    viewPadding?: number

    A proportion (0..1+) of extra area around the visible region used for spawning. For example, 0.2 extends the spawn region by 20% in each dimension.