Skip to main content

motion_canvas_rs/
lib.rs

1#![doc = include_str!("../README.md")]
2
3pub mod engine;
4
5pub mod render;
6
7// --- RE-EXPORTS ---
8
9/// Core project and scene management
10pub use engine::project::Project;
11
12/// Common mathematical types
13pub use glam::Vec2;
14
15/// Custom Result type for the library
16pub type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>;
17
18/// Font management and local font registration
19pub use engine::util::font_manager::FontManager;
20
21/// Individual node types (Circle, Rect, TextNode, etc.)
22pub mod nodes {
23    pub use crate::engine::nodes::*;
24}
25
26/// Animation flow controls and macros (all!, chain!, wait, etc.)
27pub mod flows {
28    pub use crate::engine::animation::flow::*;
29    // Re-export macros at the module level as well
30    pub use crate::{all, any, chain, delay, loop_anim, sequence};
31    #[cfg(feature = "audio")]
32    pub use crate::{audio_wait, play};
33}
34
35/// Easing functions (cubic_in, elastic_out, etc.)
36pub mod easings {
37    pub use crate::engine::easings::*;
38}
39
40/// Common types for a quick start
41pub mod prelude {
42    pub use crate::engine::project::Project;
43
44    // Core Traits
45    pub use crate::engine::animation::base::Animation;
46    pub use crate::engine::animation::base::Node;
47    pub use crate::engine::animation::tween::Signal;
48    pub use crate::engine::animation::tween::Tweenable;
49
50    // Export the modules themselves for namespaced access
51    pub use crate::easings;
52    pub use crate::flows;
53    pub use crate::nodes;
54
55    // Glob-export for direct access (e.g. Circle, all!, quad_in)
56    pub use crate::engine::animation::flow::*;
57    pub use crate::engine::easings::*;
58    #[cfg(feature = "code")]
59    pub use crate::engine::nodes::CodeNode;
60    #[cfg(feature = "image")]
61    pub use crate::engine::nodes::ImageNode;
62    #[cfg(feature = "math")]
63    pub use crate::engine::nodes::MathNode;
64    pub use crate::engine::nodes::Polygon;
65    pub use crate::engine::nodes::*;
66    pub use crate::{all, any, chain, delay, loop_anim, sequence, with_easing};
67    #[cfg(feature = "audio")]
68    pub use crate::{audio_wait, play};
69
70    pub use crate::FontManager;
71    pub use crate::Result;
72    pub use glam::Vec2;
73    pub use vello::kurbo::{Affine, BezPath};
74    pub use vello::peniko::Color;
75    pub use vello::Scene;
76
77    // Utility Types
78    pub use crate::engine::util::palette::Palette;
79}