Crates.io | dialogos |
lib.rs | dialogos |
version | 0.1.1 |
source | src |
created_at | 2022-09-14 17:57:47.945524 |
updated_at | 2022-09-14 18:28:33.788926 |
description | A super simple dialogue system for Rust. |
homepage | |
repository | https://github.com/AlexandrosKap/dialogos/ |
max_upload_size | |
id | 665970 |
size | 19,217 |
A super simple dialogue system for Rust.
It's nothing special, but that's the point! It's something that just works. This library is ideal for games that are made for a game jam. For more complex games I would recommend extending Dialogos or using something else.
Add Dialogos as a dependency to Cargo.toml
[dependencies]
dialogos = { git = "https://github.com/AlexandrosKap/dialogos" }
And then open the documentation with
cargo doc --open
A Hello World example
use dialogos::*;
fn main() {
let alex = |cont| text("Alex", cont);
let mut d = Dialogue::new(vec![
alex("Hello world."),
alex("Something something."),
alex("The end."),
]);
while !d.has_end() {
let line = d.line();
println!("{}: {}", line.info, line.cont);
d.next();
}
}