shuyi_ui/frame.rs
1//! The frame (game ADR-0003): the [`GlyphBuffer`] console every screen draws
2//! into, [`ConsoleSpec`] cells big, with its pictures and rectangles
3//! ([`Item`]s, in [`Layer`]s) and its [`Backdrop`]; colors by name
4//! ([`Rgb`], [`Palette`]); the text form snapshot tests read
5//! ([`snapshot`]); fitting the console to a window ([`console`]), a shot
6//! to a backdrop ([`cinema`]) and a picture to an area ([`portrait`]);
7//! pictures a skin paints at run time ([`painted`], ADR-0078); the debug
8//! view's shapes ([`gizmo`], ADR-0085), drawn by the integer pixel rules
9//! of [`shape`]; and
10//! the one-bit renderer ([`onebit`]); with the `raster` feature, the
11//! software painter whose picture every backend must match
12//! ([`raster`]).
13//!
14//! The drawing helpers skins share ([`draw`]): [`GlyphBuffer::panel`] (a
15//! box with a title in its border), [`GlyphBuffer::meter`] (a bar that
16//! shows how full something is), [`GlyphBuffer::print_centred`] and
17//! [`GlyphBuffer::print_cut`] (a line centred in a rectangle, or cut to a
18//! width), next to [`GlyphBuffer::print`], [`GlyphBuffer::fill_rect`] and
19//! [`GlyphBuffer::draw_box`].
20//!
21//! The game picks the console's size when it starts; nothing here knows
22//! it.
23
24pub mod cinema;
25pub mod color;
26pub mod console;
27pub mod draw;
28pub mod gizmo;
29pub mod glyph_buffer;
30pub mod onebit;
31pub mod painted;
32pub mod portrait;
33#[cfg(any(test, feature = "raster"))]
34pub mod raster;
35pub mod shape;
36pub mod snapshot;
37
38pub use color::{ColorSet, EngineColor, Palette, Rgb};
39pub use console::ConsoleSpec;
40pub use gizmo::{GizmoItem, GizmoRole, GizmoShape, LabelText};
41pub use glyph_buffer::{
42 Backdrop, BoxStyle, Cell, GlyphBuffer, Item, Layer, Overlay, Paint, PxRect, Rect, Sprite,
43};
44pub use painted::{Painted, PaintedId, PaintedKind, PaintedSprite, PaintedTable};
45
46#[cfg(test)]
47mod tests;