@pentaio/pentio-core
v0.1.3
Published
Pentio core animation engine — types, interpolation, easing, and math utilities.
Maintainers
Readme
@pentaio/pentio-core
Core runtime package for Pentio.
@pentaio/pentio-core contains shared project types, interpolation utilities, math helpers, and the PentioEngine state machine runtime used by all platform renderers.
Install
npm i @pentaio/pentio-coreWhat this package provides
- Project types:
PentioProject,Layer,Clip,StateMachine,Param,Action - Runtime:
PentioEngine - Interpolation helpers:
interpolateNumber,interpolateColor,interpolateVector2,interpolatePathPoints - Math helpers:
localToCanvas,canvasDeltaToLocal,getPathBounds,pathPointsToSvg
Quick start
import { PentioEngine, type PentioProject } from "@pentaio/pentio-core";
const project: PentioProject = JSON.parse(projectJsonString);
const engine = new PentioEngine(project);
// advance runtime by delta time in seconds
engine.tick(1 / 60);
// update runtime params (name or id)
engine.setParam("Param_0", true);Notes
@pentaio/pentio-coredoes not render to DOM or Canvas by itself.- For browser rendering use
@pentaio/pentio-player. - For framework wrappers use
@pentaio/pentio-react,@pentaio/pentio-vue,@pentaio/pentio-svelte, or@pentaio/pentio-react-native.
License
MIT
