Skip to main content

ParticleContainer

NOTE: Writing PIXI apps in vanilla js (the imperative way) is always more performant. The React reconciler needs to pass and validate props which can be costly when dealing with lots of components.

Most of the time you won't notice any difference though (rendering 1000 sprites in a particle container is still fast).

Props

https://pixijs.download/dev/docs/PIXI.ParticleContainer.html

maxSize

The maximum number of particles that can be rendered by the container. Affects size of allocated buffers. This will only affect the component once and will be applied during creation.

properties

The properties of children that should be uploaded to the gpu and applied.

PropDefault ValueDescription
vertices booleanfalseWhen true, vertices be uploaded and applied. if sprite's scale/anchor/trim/frame/orig is dynamic, please set true.
position booleantrueWhen true, position be uploaded and applied.
rotation booleanfalseWhen true, rotation be uploaded and applied.
uvs booleanfalseWhen true, uvs be uploaded and applied.
tint booleanfalseWhen true, alpha and tint be uploaded and applied.

batchSize

Number of particles per batch. If less than maxSize, it uses maxSize instead.

autoResize

If true, container allocates more batches in case there are more than maxSize particles.

Usage

Live Editor
Result
Loading...

Example