LogoPixi’VN
pixi-jsInterfaces

Interface: IParticle

Defined in: node_modules/pixi.js/lib/scene/particle-container/shared/Particle.d.ts:32

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

Example

// 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

Standard

Properties

anchorX

> anchorX: number

Defined in: node_modules/pixi.js/lib/scene/particle-container/shared/Particle.d.ts:51

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

Default

0

anchorY

> anchorY: number

Defined in: node_modules/pixi.js/lib/scene/particle-container/shared/Particle.d.ts:56

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

Default

0

color

> color: number

Defined in: node_modules/pixi.js/lib/scene/particle-container/shared/Particle.d.ts:66

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

Default

0xffffffff

rotation

> rotation: number

Defined in: node_modules/pixi.js/lib/scene/particle-container/shared/Particle.d.ts:61

The rotation of the particle in radians

Default

0

scaleX

> scaleX: number

Defined in: node_modules/pixi.js/lib/scene/particle-container/shared/Particle.d.ts:41

The horizontal scale factor of the particle

Default

1

scaleY

> scaleY: number

Defined in: node_modules/pixi.js/lib/scene/particle-container/shared/Particle.d.ts:46

The vertical scale factor of the particle

Default

1

texture

> texture: Texture

Defined in: node_modules/pixi.js/lib/scene/particle-container/shared/Particle.d.ts:68

The texture used to render this particle


x

> x: number

Defined in: node_modules/pixi.js/lib/scene/particle-container/shared/Particle.d.ts:34

The x-coordinate of the particle position


y

> y: number

Defined in: node_modules/pixi.js/lib/scene/particle-container/shared/Particle.d.ts:36

The y-coordinate of the particle position