Skip to content

Interface: IParticleRenderer ​

Many textured quads drawn as one drawable — a particle system. The framework simulates (Particles/ParticleSimulation.ts); the backend only draws what it's handed each frame.

SetParticleData's data holds PARTICLE_STRIDE floats per particle, in draw order and the node's y-up space: x, y, rotation (radians, counter-clockwise), width, height (px; negative = flipped), alpha, frame. colors holds 0xRRGGBB per particle. Width is the particle's size; the height is scaled by the frame's aspect, so a square size keeps the image's shape. frame indexes the texture's tilesX × tilesY grid, row by row from the top-left. The bounds are the particles' extent in node space (filters / materials size themselves to it).

Methods ​

CreateParticles() ​

ts
CreateParticles(): number;

Returns ​

number


DestroyParticles() ​

ts
DestroyParticles(handle): void;

Parameters ​

ParameterType
handlenumber

Returns ​

void


SetParticleBlendMode() ​

ts
SetParticleBlendMode(handle, mode): void;

Parameters ​

ParameterType
handlenumber
modeParticleBlendMode

Returns ​

void


SetParticleData() ​

ts
SetParticleData(
   handle, 
   data, 
   colors, 
   count, 
   minX, 
   minY, 
   maxX, 
   maxY
): void;

Parameters ​

ParameterType
handlenumber
dataFloat32Array
colorsUint32Array
countnumber
minXnumber
minYnumber
maxXnumber
maxYnumber

Returns ​

void


SetParticleTexture() ​

ts
SetParticleTexture(
   handle, 
   assetId, 
   tilesX, 
   tilesY
): void;

Empty asset id = a white square.

Parameters ​

ParameterType
handlenumber
assetIdstring
tilesXnumber
tilesYnumber

Returns ​

void


SetParticleTrails() ​

ts
SetParticleTrails(
   handle, 
   vertices, 
   colors, 
   vertexCount, 
   indices, 
   indexCount, 
   minX, 
   minY, 
   maxX, 
   maxY
): void;

Parameters ​

ParameterType
handlenumber
verticesFloat32Array
colorsUint32Array
vertexCountnumber
indicesUint32Array
indexCountnumber
minXnumber
minYnumber
maxXnumber
maxYnumber

Returns ​

void


SetParticleTrailTexture() ​

ts
SetParticleTrailTexture(handle, assetId): void;

Trails, drawn under the particles: a triangle list in node space — TRAIL_VERTEX_STRIDE floats per vertex (x, y, u along, v across), an RGBA colour per vertex (bytes r, g, b, a, straight alpha) and the indices. Index entries past indexCount are zero. The arrays are reused frame to frame (same objects until they grow). A backend without a way to draw them may ignore both calls.

Parameters ​

ParameterType
handlenumber
assetIdstring

Returns ​

void

© 2026 PlayAdGentic