3 releases
Uses old Rust 2015
0.1.2 | Nov 15, 2018 |
---|---|
0.1.1 | Nov 12, 2018 |
0.1.0 | Nov 12, 2018 |
#15 in #ggez
19KB
415 lines
Introduction
statez provides basic state management for ggez.
StateManager
is a wrapper for ggez::event::EventHandler
. It keeps track of
State
s in a stack and passes events received to the topmost (i.e. active)
State
. Data can be shared between State
s.
State::update()
should return a StateTransition
that tells the
StateManager
what should happen next.
Examples
hello_world
: The simplest example of switching between two states.using_shared_data
: An example of a) two states accessing shared data and b) a state allowing previous states to be drawn underneath it by returning true in State::draw_previous_state().
lib.rs
:
Introduction
statez provides basic state management for
ggez.
StateManager
is a wrapper for
ggez::event::EventHandler
. It keeps track of State
s
in a stack and passes events received to the topmost (i.e. active) State
.
Data can be shared between State
s.
State::update()
should return a
StateTransition
that tells the StateManager
what should happen next.
Examples
- hello_world: The simplest example of switching between two states.
- using_shared_data: An example of a) two states accessing shared
data and b) a state allowing previous states to be drawn underneath it
by returning
true
inState::draw_previous_state()
.
Dependencies
~33–46MB
~816K SLoC