Skip to main content

vecta_core 1.0.0 copy "vecta_core: ^1.0.0" to clipboard
vecta_core: ^1.0.0 copied to clipboard

Runtime principal for Vecta animation - ties together parser, state machine, and bones.

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 .vecta files (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.

0
likes
150
points
9
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Runtime principal for Vecta animation - ties together parser, state machine, and bones.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

vecta_bones, vecta_parser, vecta_state

More

Packages that depend on vecta_core