BintzGavin/helios / skills/examples/pixi
example-pixi
VerifiedPixiJS integration patterns for Helios. Use when creating high-performance WebGL 2D animations with PixiJS.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 1.8 KB |
SKILL.md
View on GitHub---
name: example-pixi
description: PixiJS integration patterns for Helios. Use when creating high-performance WebGL 2D animations with PixiJS.
---
# PixiJS + Helios
Integrate Helios with PixiJS by driving the Pixi scene properties from the Helios subscription loop.
## Quick Start
```typescript
import { Helios } from '@helios-project/core';
import { Application, Graphics } from 'pixi.js';
// 1. Initialize Pixi
const app = new Application();
await app.init({ resizeTo: window });
document.body.appendChild(app.canvas);
// 2. Initialize Helios
const helios = new Helios({ fps: 30, duration: 5 });
// 3. Create Scene
const rect = new Graphics().rect(0, 0, 100, 100).fill(0xff0000);
rect.pivot.set(50, 50);
rect.position.set(app.screen.width / 2, app.screen.height / 2);
app.stage.addChild(rect);
// 4. Bind Timeline (Crucial for Renderer)
helios.bindToDocumentTimeline();
// 5. Drive Animation
helios.subscribe((state) => {
const t = state.currentTime;
// Update properties based on time
rect.rotation = t * 1.5;
rect.x = (app.screen.width / 2) + Math.sin(t) * 100;
});
```
## Key Patterns
### Bind to Document Timeline
PixiJS and other WebGL libraries often have their own internal tickers. To ensure frame-perfect rendering during export (via `Renderer`), you must bind Helios to the `document.timeline`.
```typescript
helios.bindToDocumentTimeline();
```
This allows the `Renderer` (via `CdpTimeDriver`) to control the global clock, which PixiJS respects if properly synchronized.
### Disable Internal Ticker (Optional but Recommended)
If you are strictly driving the scene via `helios.subscribe()`, you might not need Pixi's internal ticker for animation logic, though Pixi still needs to render. The standard pattern is to let Pixi render naturally but update *state* in the Helios subscriber.
## Source Files
- Example: `examples/pixi-canvas-animation/`
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |