Crates.io | besida |
lib.rs | besida |
version | 0.1.1 |
source | src |
created_at | 2023-08-20 05:26:37.442566 |
updated_at | 2023-09-03 07:07:48.59981 |
description | Language for defining branching dialogue |
homepage | |
repository | |
max_upload_size | |
id | 949182 |
size | 9,673 |
Moving forward I want to add more events such as expressions/emotions of speaker, text speed control, text highlighting or styling in general. Also better ways to read actions when matching.
Here's an example with godot-rust where event_tick
is triggered by letter display timer to simulate typing:
#[func]
fn event_tick(&mut self) {
let Some(node) = self.besida.get_node_mut() else { return };
let Some(event) = node.get_event() else { return };
let mut dialogue_box = self
.base
.get_parent()
.unwrap()
.get_node_as::<DialogueBox>("DialogueBox");
match event {
Event::PrintChar(char) => {
let speech = dialogue_box.bind().get_speech();
let new_speech = format!("{}{}", speech, char);
dialogue_box.bind_mut().set_speech(new_speech.into());
}
_ => {},
}
node.next_event();
}