Trait veloren_voxygen::PlayState
source · pub trait PlayState {
// Required methods
fn enter(&mut self, global_state: &mut GlobalState, direction: Direction);
fn tick(
&mut self,
global_state: &mut GlobalState,
events: Vec<Event>,
) -> PlayStateResult;
fn name(&self) -> &'static str;
fn capped_fps(&self) -> bool;
fn globals_bind_group(&self) -> &GlobalsBindGroup;
fn render(&self, drawer: &mut Drawer<'_>, settings: &Settings);
fn egui_enabled(&self) -> bool;
}
Expand description
A trait representing a playable game state. This may be a menu, a game session, the title screen, etc.
Required Methods§
sourcefn enter(&mut self, global_state: &mut GlobalState, direction: Direction)
fn enter(&mut self, global_state: &mut GlobalState, direction: Direction)
Called when entering this play state from another
sourcefn tick(
&mut self,
global_state: &mut GlobalState,
events: Vec<Event>,
) -> PlayStateResult
fn tick( &mut self, global_state: &mut GlobalState, events: Vec<Event>, ) -> PlayStateResult
Tick the play state
sourcefn capped_fps(&self) -> bool
fn capped_fps(&self) -> bool
Determines whether the play state should have an enforced FPS cap
fn globals_bind_group(&self) -> &GlobalsBindGroup
sourcefn egui_enabled(&self) -> bool
fn egui_enabled(&self) -> bool
Determines whether egui will be rendered for this play state