Skip to main content

oxframe_core/
lib.rs

1//! Core of oxframe: signals, tweens, easing and a deterministic,
2//! single-threaded coroutine executor.
3//!
4//! An animation is an `async fn`; every `.await` on a [`Tween`],
5//! [`wait_for`] or [`next_frame`] is a frame boundary. One poll of the root
6//! future is exactly one frame, with a fixed `dt = 1 / fps`.
7
8#![warn(missing_docs)]
9
10mod color;
11mod ease;
12mod executor;
13mod flow;
14mod lerp;
15mod paint;
16mod path;
17mod runtime;
18mod signal;
19mod tween;
20
21pub use color::Color;
22pub use ease::{CubicBezier, Ease, presets};
23pub use ease::{bounce_in, bounce_in_out, bounce_out, elastic_in, elastic_in_out, elastic_out};
24pub use executor::Executor;
25pub use flow::{
26    All, BoxFuture, JoinHandle, all, all_vec, next_frame, sequence, spawn, wait_for, wait_until,
27};
28pub use lerp::{Lerp, Transform};
29pub use paint::{BlendMode, Gradient, GradientKind};
30pub use runtime::{
31    dt, ease_named, fps, frame, meta_snapshot, now, random, random_range, time, tunable, with_rng,
32};
33
34pub use rand;
35pub use signal::Signal;
36pub use tween::Tween;
37
38pub use kurbo::{self, Affine, BezPath, Point, Vec2};
39
40/// Times are compared with this tolerance so that sums of `f64` seconds
41/// (`0.1 + 0.2`) land on the frame they were meant for.
42pub const TIME_EPSILON: f64 = 1e-9;