Struct caper::game::Game
[−]
[src]
pub struct Game { pub input: Input, pub renderer: Renderer, pub physics: World<f32>, pub audio: Audio, pub cam_state: CamState, // some fields omitted }
Struct for creating an instance of a game with all systems and items contained
Fields
input: Input
The input system for the game
renderer: Renderer
The render system for the game
physics: World<f32>
The physics system
audio: Audio
The audio system
cam_state: CamState
Simple struct for camera data
Methods
impl Game
[src]
fn new() -> Game
Creates a new instance of a game
fn render_items_len(&self) -> usize
Get the len of render_items
fn get_render_item(&mut self, index: usize) -> &mut RenderItem
Get a ref to a render item
fn get_render_item_by_name(&mut self, name: String) -> Option<&mut RenderItem>
Get a ref to a render item from its name, returning the first found
fn add_render_item(&mut self, render_item: RenderItem)
Add a render item to the game
fn text_items_len(&self) -> usize
Get the len of render_items
fn get_text_item(&mut self, index: usize) -> &mut TextItem
Get a ref to a text item
fn get_text_item_by_name(&mut self, name: String) -> Option<&mut TextItem>
Get a ref to a text item from its name, returning the first found
fn add_text_item(&mut self, text_item: TextItem)
Add a text item to the game
fn update<F: FnMut(&Ui)>(&mut self, render_imgui: F)
Starting the game loop