Expand description

A simple example dialogue view for Yarn Spinner. A dialogue view is a plugin that handles presenting lines and options to the user and advances the dialogue on user input. This one shows text in a dialogue box inspired by Legend of Zelda: Breath of the Wild.

§Demo

The Yarn Spinner for Rust Demo uses this dialogue view, so you can play that in the browser if you want to see it in action. Additionally, all Bevy Yarn Spinner examples use this dialogue view as well.

§Usage

It’s enough to simply register ExampleYarnSpinnerDialogueViewPlugin alongside YarnSpinnerPlugin:

use bevy::prelude::*;
use bevy_yarnspinner::*;
use bevy_yarnspinner::prelude::YarnSpinnerPlugin;
use bevy_yarnspinner_example_dialogue_view::prelude::*;

App::new()
   .add_plugins(DefaultPlugins)
   .add_plugins(YarnSpinnerPlugin::new())
   .add_plugins(ExampleYarnSpinnerDialogueViewPlugin::new());

This crate also exposes the SpeakerChangeEvent which you can use to animate characters while they are speaking, as the text is written out over a few seconds.

§Inputs

  • Advance the dialogue: press the space bar, enter key, left click or tap the screen after the text is done typing.
  • Type out the text faster: Same as above, but hold press before the text is done typing.
  • Select an option: press the number key corresponding to the option you want to select or click/tap the option.

§Limitations

This dialogue view expects only a single instance of DialogueRunner to be running. Its behavior is otherwise undefined.

Modules§

  • Everything you need to get starting using this example Yarn Spinner dialogue view.

Structs§