Struct nitro::game_object::GameObject
[−]
[src]
pub struct GameObject { pub transform: Transform, pub sprite: Option<Sprite>, pub body: Option<RigidBodyHandle<f32>>, pub draw_layer: i32, // some fields omitted }
GameObjects are the primary descriptor for things that are visible in the game world. Players, items, enemies, and whatever else exists in your game world are typically GameObjects.
To create a new GameObject use nitro::App::new_gameobject().
Fields
transform: Transform
sprite: Option<Sprite>
body: Option<RigidBodyHandle<f32>>
draw_layer: i32
Methods
impl GameObject
[src]
fn id(&self) -> u64
[src]
fn drop(&mut self)
[src]
fn send_message_to_component(
&mut self,
app: &mut App,
message: &Message,
component_id: i32
)
[src]
&mut self,
app: &mut App,
message: &Message,
component_id: i32
)
fn receive_message(&mut self, app: &mut App, message: &Message)
[src]
fn update(&mut self, app: &mut App, delta_time: f32)
[src]
fn component_keys<'a>(&'a self) -> Box<Iterator<Item = i32> + 'a>
[src]
fn component_keys_with_type<'a, T>(&'a self) -> Box<Iterator<Item = i32> + 'a> where
T: Component + 'static,
[src]
T: Component + 'static,
fn remove_component(
&mut self,
app: &mut App,
index: i32
) -> OptionLoaned<Box<ComponentAny>>
[src]
&mut self,
app: &mut App,
index: i32
) -> OptionLoaned<Box<ComponentAny>>
fn component(&self, index: i32) -> OptionLoaned<&Box<ComponentAny>>
[src]
fn component_mut(&mut self, index: i32) -> OptionLoaned<&mut Box<ComponentAny>>
[src]
fn component_with_type<T>(&self, index: i32) -> Option<&T> where
T: Component + 'static,
[src]
T: Component + 'static,
fn component_mut_with_type<T>(&mut self, index: i32) -> Option<&mut T> where
T: Component + 'static,
[src]
T: Component + 'static,
fn insert_component<T>(
&mut self,
app: &mut App,
component: T,
index: i32
) -> Option<Box<ComponentAny>> where
T: Component + 'static,
[src]
&mut self,
app: &mut App,
component: T,
index: i32
) -> Option<Box<ComponentAny>> where
T: Component + 'static,
fn add_component<T>(&mut self, app: &mut App, component: T) -> i32 where
T: Component + 'static,
[src]
T: Component + 'static,