원클릭으로
example-p5-animation
Learn how to use P5.js with Helios. Use when creating creative coding sketches or generative art.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Learn how to use P5.js with Helios. Use when creating creative coding sketches or generative art.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Collection of agent skills for Helios video engine. Use when working with programmatic video creation, browser-native animations, or Helios compositions. Install individual skills by path for specific capabilities.
Core API for Helios video engine. Use when creating compositions, managing timeline state, controlling playback, or subscribing to frame updates. Covers Helios class instantiation, signals, animation helpers, and DOM synchronization.
Patterns for using Helios with Vanilla Canvas API. Use when building high-performance 2D/3D animations without frameworks.
Chart.js integration patterns for Helios. Use when creating animated data visualizations with Chart.js.
Learn how to use D3.js with Helios for data visualization. Use when creating charts, graphs, or data-driven animations.
Patterns for using Helios with Framer Motion. Use when you want to use Framer Motion's physics and transitions but need frame-perfect synchronization with Helios.
| name | example-p5-animation |
| description | Learn how to use P5.js with Helios. Use when creating creative coding sketches or generative art. |
Integrate P5.js with Helios by using P5's Instance Mode and driving the draw() loop via Helios's state.
import { Helios } from '@helios-project/core';
import p5 from 'p5';
const helios = new Helios({ duration: 10, fps: 60 });
const sketch = (p: p5) => {
p.setup = () => {
p.createCanvas(1920, 1080);
p.noLoop(); // Disable P5's internal loop
};
p.draw = () => {
// Get time from Helios
const { currentFrame, fps } = helios.getState();
const time = currentFrame / fps;
p.background(200);
p.fill(255, 0, 0);
// Animate based on time
const x = time * 100;
p.circle(x, 540, 50);
};
};
new p5(sketch, document.getElementById('canvas-container'));
// Drive P5 from Helios
helios.subscribe(() => {
// Manually trigger P5 redraw
// Note: If you have a reference to the p5 instance, call instance.redraw()
// Or simply put drawing logic here directly.
});
Always use Instance Mode (new p5(sketch)) instead of Global Mode. This prevents global variable pollution and ensures compatibility with module bundlers.
Call p.noLoop() in setup(). P5's internal loop uses requestAnimationFrame which runs independently of Helios. By disabling it, you ensure P5 only draws when Helios updates.
Instead of relying on P5's frameCount, calculate positions based on helios.getState().currentFrame.
helios.subscribe(() => {
// Assuming 'myp5' is your instance
myp5.redraw();
});
examples/p5-canvas-animation/