Expand description
IFEngine is a rust framework for writing interactive fiction.
Other projects in this space include Twine and Inkle.
The goal is to enjoy an effortless writing experience, together with all the benefits of the Rust ecosystem.
To use this library, you write functions which produce Responses, eventualling resolving to a View.
Such functions are called Pages, and are decorated by the #[ifview] macro.
A starting page is used to initialize the Game, which can then be called upon to yield its current view through Game::view, and updated by interacting with the view.
A view consists of a sequence of Objects which you can attach by calling the provided elements and macros within the page.
Re-exports§
Modules§
- core
- Core types and logic.
- elements
- Module containing macros that simplify creating interactive text elements and responses. Provides declarative macros to create spans, links, navigation actions and responses. Provides procedural macros for choices, paragraphs, and other clickable elements.
- run
- Simulate, interact with, and analyze a
crate::Game. - utils
- Utilities suitable for both internal and public use.
- view
- The
Viewand its constituents.
Macros§
- END
- Immediately return a
Response::End. - ENTER
- Immediately return a tunnel-type
Response. - GO
- Immediately return a transition-type
Response. - Game
- Instantiate a
Gamefrom a function decorated withcrate::ifview. - link
- Create a clickable link
Span. - s
- Create a
Spanfrom the given expression. - tun
- Create a tunnel or exit link
Span.
Enums§
Attribute Macros§
- ifview
- Decorate your function with this.