yarn-spool 0.1.0

A library for parsing and evaluating Yarn Dialogue scripts.
Documentation
  • Coverage
  • 84.62%
    11 out of 13 items documented0 out of 0 items with examples
  • Size
  • Source code size: 68.1 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 568.38 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • jdm/yarn-spool
    13 4 13
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • jdm

This is a library for parsing and evaluating Yarn Dialogue scripts in Rust games. It is designed to be embedded with game-provided hooks to affect the game state without making assumptions about how the dialogue will be displayed.

There are two main pieces:

  1. the YarnHandler trait, which provides hooks for the dialogue engine to call back into the game
  2. the YarnEngine type, which is responsible for parsing Yarn scripts and encapsulates the ongoing dialogue state

To begin a dialogue, call the YarnEngine::activate method. When it's time to move on from the current line of dialogue, call YarnEngine::proceed. If a choice is required in order to proceed, call YarnEngine::choose instead.

For an example of integrating yarn-spool into a game, look at the source of the example game.