FlatCommands

Trait FlatCommands 

Source
pub trait FlatCommands<'w, 's> {
    // Required methods
    fn root<'a>(&'a mut self, entity: Entity) -> RootCommands<'w, 's, 'a>;
    fn spawn_root<B>(&mut self, bundle: B) -> RootCommands<'w, 's, '_>
       where B: Bundle;
    fn spawn_empty_root(&mut self) -> RootCommands<'w, 's, '_>;
}

Required Methods§

Source

fn root<'a>(&'a mut self, entity: Entity) -> RootCommands<'w, 's, 'a>

Set an existing entity as the root entity of the hierarchy

Source

fn spawn_root<B>(&mut self, bundle: B) -> RootCommands<'w, 's, '_>
where B: Bundle,

Create a new entity with components from bundle and make it the root of the hierarchy

Source

fn spawn_empty_root(&mut self) -> RootCommands<'w, 's, '_>

Spawn an empty entity make it the root of the hierarchy

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'w, 's> FlatCommands<'w, 's> for Commands<'w, 's>

Source§

fn root<'a>(&'a mut self, entity: Entity) -> RootCommands<'w, 's, 'a>

Source§

fn spawn_root<'a, B>(&'a mut self, b: B) -> RootCommands<'w, 's, 'a>
where B: Bundle,

Source§

fn spawn_empty_root<'a>(&'a mut self) -> RootCommands<'w, 's, 'a>

Implementors§