vecta_core
Core runtime for the Vecta animation framework. Ties together the parser, state machine, and bones engine into a single animation runtime.
Features
- Load and animate SVGs with a declarative API
- Define bone rigs, keyframe animations, and state machines
- Export and import
.vectafiles (JSON-based format) - Designed for AI agent code generation
- Pure Dart -- no Flutter dependency
Getting started
dependencies:
vecta_core: ^1.0.0
Usage
import 'package:vecta_core/vecta_core.dart';
final runtime = VectaRuntime.fromSvg(svgString);
// Define a rig
runtime.rig(bones: [
BoneDef(name: 'root', bindTo: ['body']),
BoneDef(name: 'armLeft', parent: 'root', bindTo: ['armLeft']),
]);
// Add an animation
runtime.addAnimation(AnimationDef(
name: 'wave',
duration: const Duration(milliseconds: 600),
loop: true,
keyframes: [
Keyframe(time: 0, bone: 'armLeft', rotation: 0),
Keyframe(time: 300, bone: 'armLeft', rotation: 30, easing: Easing.easeInOut),
Keyframe(time: 600, bone: 'armLeft', rotation: 0, easing: Easing.easeInOut),
],
));
runtime.play('wave');
Additional information
Part of the Vecta monorepo. See the main repository for full documentation.
Libraries
- vecta_core
- Runtime principal for Vecta animation.