ifview

Attribute Macro ifview 

Source
#[ifview]
Expand description

Decorate your function with this.

The function must take your game state as a parameter, and return (). This macro will rewrite your function to receive a &mut [ifengine::Game] and return a [ifengine::core::Response], as well as enabling usage of [ifengine::elements] to produce that response (which in most cases will be a [ifengine::View]).

ยงExamples

 #[ifview]
 pub fn p1(s: &mut State) {
     h!("SALTWRACK", 3); // heading level 3
     p!(link!("BEGIN", p2)); // Link to the next page
 }

 // ----- mod.rs -----
 pub type Game = ifengine::Game<State>;
 pub fn new() -> Game {
    ifengine::Game!(chap1::p1)
 }