Skip to main content

Crate animato_path

Crate animato_path 

Source
Expand description

§animato-path

Motion-path primitives for Animato.

This crate provides Bezier curves, CatmullRom splines, compound paths, SVG d attribute parsing, and [MotionPathTween] for driving an object along a path with the existing tween system.

§Quick Start

use animato_core::{Easing, Update};
use animato_path::{CubicBezierCurve, MotionPathTween};

let path = CubicBezierCurve::new(
    [0.0, 0.0],
    [50.0, 100.0],
    [150.0, -100.0],
    [200.0, 0.0],
);
let mut motion = MotionPathTween::new(path)
    .duration(1.0)
    .easing(Easing::EaseInOutSine)
    .auto_rotate(true)
    .build();

motion.update(0.5);
let position = motion.value();
assert!(position[0] > 0.0);

§Feature Flags

FeatureEffect
stdEnables all path types and forwards std to dependencies
allocEnables heap-backed paths, SVG parser, and MotionPathTween
serdeDerives Serialize/Deserialize on supported public types

Re-exports§

pub use bezier::CubicBezierCurve;
pub use bezier::PathEvaluate;
pub use bezier::QuadBezier;
pub use draw::DrawSvg;
pub use draw::DrawValues;

Modules§

bezier
Bezier curves, CatmullRom splines, and the PathEvaluate trait.
draw
SVG stroke-dashoffset animation helpers.