Module pix_engine::state[][src]

Expand description

PixState methods for the PixEngine and AppState.

PixState is the global engine state and API for any application using pix-engine. A mutable reference is passed to most AppState methods and allows you to modify settings, query engine and input state, as well as drawing to the current render target.

The most common use of PixState is in the AppState::on_update method.

See the Getting Started section and the PixState page for the list of available methods.

Provided PixState methods:

Example

fn on_update(&mut self, s: &mut PixState) -> PixResult<()> {
    s.fill(s.theme().colors.primary);
    s.rect([100, 0, 100, 100])?;
    if s.button("Click me")? {
        s.text("I was clicked!");
    }
    Ok(())
}

Modules

Environment methods for the PixEngine.

Settings methods for the PixEngine.

Structs

Represents all state and methods for updating and interacting with the PixEngine.