decay/lib.rs
1//! Decay: a zero-dependency ECS TUI game framework.
2//!
3//! Build terminal games with an entity-component-system architecture,
4//! double-buffered rendering, and direct platform I/O.
5//!
6//! ```no_run
7//! use decay::prelude::*;
8//!
9//! App::new()
10//! .plugin(CorePlugins)
11//! .system(Phase::Init, |world: &mut World| {
12//! world.spawn((Node::new(4, 2, 20, 1), Text::new("Hello, decay!")));
13//! })
14//! .system(Phase::Update, |world: &mut World| {
15//! if world.resource::<Input>().is_some_and(|i| i.just_pressed(KeyCode::Char('q'))) {
16//! world.resource_mut::<AppExit>().unwrap().0 = true;
17//! }
18//! })
19//! .plugin(UiPlugin)
20//! .run();
21//! ```
22
23pub mod anim;
24pub mod audio;
25pub mod core;
26pub mod grid;
27pub mod intro;
28pub mod net;
29pub mod procgen;
30pub mod rand;
31pub mod serde;
32pub mod term;
33pub mod time;
34pub mod ui;
35
36pub mod prelude {
37 pub use crate::core::input::{Input, KeyCode, MouseEvent};
38 pub use crate::core::{
39 Added, App, AppExit, Bundle, Changed, Children, Cmd, Component, CorePlugins, Entity,
40 Events, IntroPlugin, Parent, Phase, Plugin, Resource, State, With, Without, World,
41 };
42 pub use crate::rand::Rng;
43 pub use crate::ui::{
44 Anchor, AnimatedText, BorderStyle, Button, Container, Interaction, Node, Panel,
45 ProgressBar, ProgressStyle, Separator, Spinner, SpinnerStyle, Text, TextAlign, UiPlugin,
46 UiStyle, ZIndex,
47 };
48}