Skip to content

1681-engine / pixel / pixelPaint / spark

Function: spark() ​

ts
function spark(
   g, 
   x, 
   y, 
   color, 
   size, 
   frame?
): void;

Defined in: src/pixel/pixelParticles.ts:15

A spark of size 1 (one pixel, glinting every third frame), 2 (a plus with a lit centre) or 3 (a four-point star whose arms twinkle with frame), shaded from color's ramp, on the 1-px world grid.

Parameters ​

ParameterTypeDefault value
gGraphicsundefined
xnumberundefined
ynumberundefined
colornumberundefined
size1 | 2 | 3undefined
framenumber0

Returns ​

void

Released under the MIT License.