Struct amethyst_ui::UiCreator [−][src]
pub struct UiCreator<'a, I = TextureFormat, F = FontFormat> where
I: Format<Texture, Options = TextureMetadata> + Sync,
F: Format<FontAsset, Options = ()> + Sync, { /* fields omitted */ }
Ui Creator, wrapper around loading and creating a UI directly.
The recommended way of using this in States is with world.exec.
Type parameters:
I:Formatused for loadingTexturesF:Formatused for loadingFontAsset
Example:
ⓘThis example is not tested
let ui_handle = world.exec(|creator: UiCreator| { creator.create("renderable.ron", ()) });
Methods
impl<'a, I, F> UiCreator<'a, I, F> where
I: Format<Texture, Options = TextureMetadata> + Sync + for<'b> Deserialize<'b>,
F: Format<FontAsset, Options = ()> + Sync + for<'b> Deserialize<'b>, [src]
impl<'a, I, F> UiCreator<'a, I, F> where
I: Format<Texture, Options = TextureMetadata> + Sync + for<'b> Deserialize<'b>,
F: Format<FontAsset, Options = ()> + Sync + for<'b> Deserialize<'b>, pub fn create<N, P>(&mut self, name: N, progress: P) -> Entity where
N: Into<String>,
P: Progress, [src]
pub fn create<N, P>(&mut self, name: N, progress: P) -> Entity where
N: Into<String>,
P: Progress, Create a UI.
Will load a UI from the given ron file, create an Entity and load the UI with that
Entity as the root of the UI hierarchy.
Parameters:
name: Name of aronasset in theUiFormatformatprogress: Progress tracker
Returns
The Entity that was created that will form the root of the loaded UI.
Trait Implementations
impl<'a, I, F> SystemData<'a> for UiCreator<'a, I, F> where
I: Format<Texture, Options = TextureMetadata> + Sync,
F: Format<FontAsset, Options = ()> + Sync,
UiLoader<'a, I, F>: SystemData<'a>,
Entities<'a>: SystemData<'a>,
WriteStorage<'a, Handle<UiPrefab<I, F>>>: SystemData<'a>, [src]
impl<'a, I, F> SystemData<'a> for UiCreator<'a, I, F> where
I: Format<Texture, Options = TextureMetadata> + Sync,
F: Format<FontAsset, Options = ()> + Sync,
UiLoader<'a, I, F>: SystemData<'a>,
Entities<'a>: SystemData<'a>,
WriteStorage<'a, Handle<UiPrefab<I, F>>>: SystemData<'a>, fn setup(res: &mut Resources)[src]
fn setup(res: &mut Resources)Sets up the system data for fetching it from the Resources.
fn fetch(res: &'a Resources) -> Self[src]
fn fetch(res: &'a Resources) -> SelfFetches the system data from Resources. Note that this is only specified for one concrete lifetime 'a, you need to implement the SystemData trait for every possible lifetime. Read more
fn reads() -> Vec<ResourceId>[src]
fn reads() -> Vec<ResourceId>Returns all read dependencies as fetched from Self::fetch. Read more
fn writes() -> Vec<ResourceId>[src]
fn writes() -> Vec<ResourceId>Returns all write dependencies as fetched from Self::fetch. Read more