Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/canvas/mod.ts>Particles

Canvas API for Deno, ported from canvaskit-wasm (Skia).
Go to Latest
interface Particles
implements EmbindObject<Particles>
import { type Particles } from "https://deno.land/x/canvas@v1.0.0/mod.ts";

See SkParticleEffect.h for more details.

Methods

draw(canvas: SkCanvas): void

Draws the current state of the particles on the given canvas.

effectUniforms(): Float32Array

Returns a Float32Array bound to the WASM memory of these uniforms. Changing these floats will change the corresponding uniforms instantly.

getEffectUniform(index: number): ParticlesUniform

Returns the nth uniform from the effect.

getEffectUniformCount(): number

Returns the number of uniforms on the effect.

getEffectUniformFloatCount(): number

Returns the number of float uniforms on the effect.

getEffectUniformName(index: number): string

Returns the name of the nth effect uniform.

getParticleUniform(index: number): ParticlesUniform

Returns the nth uniform on the particles.

getParticleUniformCount(): number

Returns the count of uniforms on the particles.

getParticleUniformFloatCount(): number

Returns the number of float uniforms on the particles.

getParticleUniformName(index: number): string

Returns the name of the nth particle uniform.

particleUniforms(): Float32Array

Returns a Float32Array bound to the WASM memory of these uniforms. Changing these floats will change the corresponding uniforms instantly.

setPosition(point: SkPoint): void

Sets the base position of the effect.

setRate(rate: number): void

Sets the base rate of the effect.

start(now: number, looping: boolean): void

Starts playing the effect.

update(now: number): void

Updates the effect using the new time.