Skip to main content

btkramaframe

Macro btkramaframe 

Source
macro_rules! btkramaframe {
    (<$TRES:ty, $PRES:ty>
        $(
            $class:literal $easing:ident [ $($key:literal),* $(,)? ] $duration:literal s ;
        )+
    ) => { ... };
    (<$TRES:ty, $PRES:ty> $class:literal $easing:ident [ $($key:literal),* $(,)? ] $duration:literal s ) => { ... };
}
Expand description

Creates a KramaFrame instance initialized with BTreeMap storage (Heap allocated).

This macro provides a convenient, declarative syntax for initializing a KramaFrame that uses BTreeMap (standard library). It mimics the syntax of ukramaframe! but constructs the maps dynamically.

Requires the std or alloc feature (implied by usage of BTreeMap).

§Syntax

btkramaframe!(
    <TRES, PRES>
    "class_name" EasingFunction [key_id1, key_id2, ...] duration s ;
    ...
);
  • TRES, PRES: Timing and Progress resolution types.
  • IDs are strictly u32 for BTreeMap implementation.

§Example

let mut anim = btkramaframe!(
    <u32, i32>
    "fade" EaseIn [1, 2] 1.0 s;
    "slide" Linear [10] 2.5 s;
);