skia-rs-skottie

Crates.ioskia-rs-skottie
lib.rsskia-rs-skottie
version0.2.0
created_at2026-01-03 18:48:00.15204+00
updated_at2026-01-03 18:48:00.15204+00
descriptionLottie animation support for skia-rs (Skottie)
homepagehttps://github.com/pegasusheavy/skia-rs
repositoryhttps://github.com/pegasusheavy/skia-rs
max_upload_size
id2020611
size165,476
Joseph R. Quinn (quinnjr)

documentation

https://docs.rs/skia-rs-skottie

README

skia-rs-skottie

Lottie animation support for skia-rs, providing a Rust implementation of Skia's Skottie library.

Features

  • JSON Parsing: Full Lottie JSON format support
  • Animation Playback: Timeline-based animation with frame interpolation
  • Shape Layers: Paths, fills, strokes, gradients
  • Transform Animations: Position, scale, rotation, opacity
  • Masks & Mattes: Alpha masks, track mattes
  • Expressions: Subset of Lottie expressions

Usage

use skia_rs_skottie::{Animation, AnimationBuilder};

// Load from JSON string
let animation = Animation::from_json(json_string)?;

// Get animation properties
println!("Duration: {} seconds", animation.duration());
println!("Frame rate: {} fps", animation.fps());
println!("Size: {}x{}", animation.width(), animation.height());

// Render a specific frame
let canvas = /* your canvas */;
animation.render(canvas, frame_time);

// Or seek to normalized time (0.0 - 1.0)
animation.seek(0.5); // Seek to 50%
animation.render(canvas, None);

Supported Features

Layers

  • Shape layers
  • Solid layers
  • Image layers (references)
  • Precomposition layers
  • Null layers

Shapes

  • Rectangle
  • Ellipse
  • Path
  • Polystar
  • Fill
  • Stroke
  • Gradient fill/stroke
  • Group
  • Trim paths

Transforms

  • Position
  • Anchor point
  • Scale
  • Rotation
  • Opacity
  • Skew

Effects

  • Masks (Add, Subtract, Intersect, Difference)
  • Track mattes (Alpha, Alpha Inverted, Luma, Luma Inverted)

License

MIT OR Apache-2.0

Commit count: 0

cargo fmt