dinamika
The umbrella crate of the dinamika project: a single dependency that brings
together the whole stack — the dinamika-cpu
raster renderer and the dinamika-core
declarative animation library.
In the spirit of Motion Canvas: a scene of flex-laid-out shapes whose properties are reactive signals, animated on a timeline and rendered to PNG frames — all on the CPU, with no GPU dependency.
Layout
This crate re-exports the two underlying crates and lifts the animation API to its root:
| Path | What it is |
|---|---|
dinamika::core |
the dinamika-core animation library |
dinamika::cpu |
the dinamika-cpu raster renderer |
dinamika::* |
flat re-export of the dinamika-core public API |
So use dinamika::* is equivalent to use dinamika_core::*, and the renderer
stays reachable as dinamika::cpu (or dinamika::core::cpu).
Install
[]
= "0.1"
Prefer the individual crates if you only need one layer:
dinamika-core for animation, or
dinamika-cpu for raster rendering
alone.
Example
use *;
// The timeline is created first (interior mutability — no `mut`).
let tl = new;
// Scene: a row container with two squares, registered on the timeline.
let a = rect.background.size;
let b = rect.background.size;
let _row = rect
.at
.background
.radius
.direction
.gap
.padding
.align
.child
.child
.on;
// Animate two properties in parallel, pause, then render to PNG frames.
tl.parallel;
tl.pause;
tl.render.unwrap;
For the full animation API (shapes, signals, the timeline, text and code with
syntax highlighting) see the dinamika-core
documentation; for the drawing primitives see
dinamika-cpu.
The demonstration scene can be rendered with the command:
cargo run -p dinamika
License
Licensed under the MIT license.