pixi.js
    Preparing search index...

    Interface IParticle

    Represents a particle with properties for position, scale, rotation, color, and texture. Particles are lightweight alternatives to sprites, optimized for use in particle systems.

    // Create a basic particle
    const particle = new Particle({
    texture: Texture.from('particle.png'),
    x: 100,
    y: 100,
    scaleX: 0.5,
    scaleY: 0.5,
    rotation: Math.PI / 4, // 45 degrees
    tint: 0xff0000, // Red tint
    alpha: 0.8 // Slightly transparent
    });

    // Modify particle properties
    particle.x += 10; // Move right
    particle.rotation += 0.1; // Rotate slightly
    particle.alpha = 0.5; // Change transparency

    // Use anchor points (0-1 range)
    particle.anchorX = 0.5; // Center horizontally
    particle.anchorY = 0.5; // Center vertically
    interface IParticle {
        anchorX: number;
        anchorY: number;
        color: number;
        rotation: number;
        scaleX: number;
        scaleY: number;
        texture: Texture;
        x: number;
        y: number;
    }

    Implemented by

    Index

    Properties

    anchorX: number

    The x-coordinate of the particle's anchor point (0-1 range)

    0
    
    anchorY: number

    The y-coordinate of the particle's anchor point (0-1 range)

    0
    
    color: number

    The color of the particle as a 32-bit RGBA value

    0xffffffff
    
    rotation: number

    The rotation of the particle in radians

    0
    
    scaleX: number

    The horizontal scale factor of the particle

    1
    
    scaleY: number

    The vertical scale factor of the particle

    1
    
    texture: Texture

    The texture used to render this particle

    x: number

    The x-coordinate of the particle position

    y: number

    The y-coordinate of the particle position