Skip to main content
Pixi.js is a fast 2D rendering engine built on WebGL. Helios provides deterministic frame control for exporting Pixi.js animations to video.

Basic setup

Pixi.js requires disabling its internal ticker and using Helios for frame updates.

React integration

For React applications, manage Pixi.js lifecycle in a useEffect hook.

Custom React hook

Create a reusable hook to sync with Helios frames:
Usage:

Critical patterns

Disable Pixi.js ticker

Pixi.js has an internal ticker for animations. Don’t use it with Helios:

Use Helios time for animations

Calculate all animations from state.currentFrame or state.currentTime:

Async initialization

Pixi.js v8+ requires async initialization. Always await app.init():

Performance considerations

Sprite batching

Pixi.js automatically batches sprites with the same texture. Keep sprites using the same texture together:

Graphics objects

Reuse Graphics objects instead of recreating them each frame:

Texture management

Preload textures and dispose of them when done:

Canvas resolution

Set resolution based on your export target:
Higher resolutions increase memory usage and render time.

Filters and effects

Filters are GPU-intensive. Use sparingly:

Package dependencies

Common issues

Canvas not appearing

Ensure you await Pixi.js initialization and append the canvas:

Animation stuttering

Verify Helios is properly bound and you’re not mixing ticker with Helios:

Memory leaks in React

Always destroy the Pixi.js app on unmount:

Blurry graphics

Set autoDensity and match device pixel ratio: