Skip to main content

oxframe_2d/
lib.rs

1//! 2D scene graph of oxframe.
2//!
3//! Scene code creates nodes with builders (`Rect::new().width(100.0)`) and
4//! adds them with [`Node::add`] (`view.add(..)`), which returns a `Copy`
5//! handle whose zero-argument methods of the same names return
6//! [`Signal`]s:
7//!
8//! ```ignore
9//! let r = view.add(Rect::new().size(200.0).x(-300.0));
10//! r.x().to(300.0, 1.0).await;
11//! ```
12//!
13//! Renderers consume a flat [`DrawItem`] list produced by
14//! [`SceneGraph::draw_list`], so every backend draws exactly the same thing.
15
16#![warn(missing_docs)]
17
18mod builder;
19mod draw;
20mod flex;
21mod graph;
22mod handles;
23mod image;
24mod text;
25mod trim;
26
27pub use builder::{
28    BaseProps, CircleBuilder, CodeBuilder, GridBuilder, GroupBuilder, ImgBuilder, LayoutBuilder,
29    LineBuilder, NodeBuilder, PathBuilder, PolygonBuilder, RectBuilder, StarBuilder, TxtBuilder,
30};
31pub use draw::{DrawItem, Layer, LineCap, LineJoin, Paint, Primitive, Shadow, StrokeStyle};
32pub use graph::{Direction, Justify, LayoutAlign, NodeData, NodeId, NodeKind, SceneGraph};
33pub use handles::{
34    Circle, Code, Grid, Group, Img, Layout, Line, Node, Path, Polygon, Rect, Star, Txt, View,
35};
36pub use image::{ImageSource, RasterImage, VectorImage, VectorShape};
37pub use trim::trim;
38
39pub use oxframe_core::{BlendMode, Color, Gradient, GradientKind, Signal};
40pub use oxframe_text::{Align as TextAlign, Lang, MONO, SANS};
41pub use text::{CodeTheme, RichSpan, span};