Optional
alpha?: numberThe alpha transparency (0-1)
The texture used to render this particle
Optional
tint?: ColorSourceThe tint color as a hex number or CSS color string
// Create a basic red particle
const particle = new Particle({
texture: Texture.from('particle.png'),
tint: 0xff0000,
alpha: 0.8
});
// Create a scaled and rotated particle
const rotatedParticle = new Particle({
texture: Texture.from('star.png'),
x: 100,
y: 100,
scaleX: 2,
scaleY: 2,
rotation: Math.PI / 4,
anchorX: 0.5,
anchorY: 0.5
});
// Use color strings for tint
const coloredParticle = new Particle({
texture: Texture.from('circle.png'),
tint: '#ff00ff', // Magenta
alpha: 0.5, // Half transparent
x: 200,
y: 200
});
Configuration options for creating a new particle. All properties except texture are optional and will use default values if not specified.