-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement a basic TUI example for using yarnspinner standalone (fixes #123) #182
Implement a basic TUI example for using yarnspinner standalone (fixes #123) #182
Conversation
Woooah this looks so cool! Really good job! |
Still need to review
|
Co-authored-by: Jan Hohenheim <[email protected]>
Resolved the comments and made the suggested change to the |
Checked the rest and it looks good to me! It's a bit more than an example and more of a full-blown demo, but that's okay for the moment :) I can manually move it if I decide to add some minimal examples. |
I'm having trouble running this I tried: ❯ cargo run --bin custom_command
error: `cargo run` can run at most one executable, but multiple were specified I think it's because both I then tried renaming the filename and [[bin.name]] field and I got this: ❯ cargo run --bin access_variables_without_bevy
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.25s
Running `target/debug/access_variables_without_bevy`
thread 'main' panicked at /Users/katzen/Documents/YarnSpinner-Rust/crates/compiler/src/compiler.rs:79:39:
called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace I think because it's trying to get the file from relative to the root dir and no the cargo manifest dir: let mut runner =
TuiDialogueRunner::new("./assets/dialogue/access_variables.yarn", "AccessVariables")?; oohhhhhh yah, so I guess you just gotta be in that example's directory. Yup, got it working |
ConEmu64_2024-02-24_15-45-44.mp4
As discussed on #123, this is a simple (-ish, I may have gotten slightly carrried away!) example of how to use the yarnspinner crate directly, using a TUI interface (built with
ratatui
).I used the existing Bevy examples as a starting point, as I thought it would be useful for people to be able to see how the same functionality can be achieved without a pre-built engine integration
This is my first time really working with Yarn Spinner, so I'm not 100% on whether I'm using the API optimally, but it does all seem to work! Any feedback would be much appreciated 😃