Expand description
Β§π Dialogos
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.
Β§π½ Features
- Easy to use
- Labels
- Menus
- Variables
- Mathematical operations
- Conditional statements
Β§π Installation
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
Β§π Example
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();
}
}
StructsΒ§
EnumsΒ§
- Line
Type - The line types.
FunctionsΒ§
- calc
- Parses and evaluates simple math expressions. The expressions must look like this: βn1 operator n2β
- check
- Creates a check line.
- end
- Creates an end line.
- jump
- Creates a jump line.
- label
- Creates a label line.
- menu
- Creates a menu line.
- split
- Splits a string with the dialogue split pattern.
- text
- Creates a text line.
- variable
- Creates a variable line.