Crate ifengine

Crate ifengine 

Source
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§

pub use core::Action;
pub use core::Game;
pub use view::View;

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 View and 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 Game from a function decorated with crate::ifview.
link
Create a clickable link Span.
s
Create a Span from the given expression.
tun
Create a tunnel or exit link Span.

Enums§

GameError
SimEnd

Attribute Macros§

ifview
Decorate your function with this.