dinamika 0.1.0

Umbrella crate for the dinamika toolkit: re-exports the dinamika-cpu raster renderer and the dinamika-core declarative animation library.
Documentation
  • Coverage
  • 100%
    1 out of 1 items documented0 out of 0 items with examples
  • Size
  • Source code size: 15.99 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.14 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 12s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • aviancode/dinamika
    3 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • aviancode

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

[dependencies]
dinamika = "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 dinamika::*;

// The timeline is created first (interior mutability — no `mut`).
let tl = Timeline::new(320, 160, Color::from_rgba8(20, 20, 24, 255), 30.0);

// Scene: a row container with two squares, registered on the timeline.
let a = Shape::rect().background(Color::from_rgba8(229, 192, 123, 255)).size(60.0, 60.0);
let b = Shape::rect().background(Color::from_rgba8(152, 195, 121, 255)).size(60.0, 60.0);
let _row = Shape::rect()
    .at(20.0, 20.0)
    .background(Color::from_rgba8(40, 44, 52, 255))
    .radius(12.0)
    .direction(Direction::Row)
    .gap(20.0)
    .padding(20.0)
    .align(Align::Center)
    .child(a.clone())
    .child(b.clone())
    .on(&tl);

// Animate two properties in parallel, pause, then render to PNG frames.
tl.parallel(vec![
    a.rotation(180.0).over(1.0, Easing::CubicInOut),
    b.background(Color::from_rgba8(97, 175, 239, 255)).over(1.0, Easing::Linear),
]);
tl.pause(0.25);

tl.render("outputs/demo").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.