Struct amethyst_ui::UiCreator[][src]

pub struct UiCreator<'a, A = AudioFormat, I = TextureFormat, F = FontFormat> where
    A: Format<Audio, Options = ()> + Sync,
    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: Format used for loading Textures
  • F: Format used for loading FontAsset

Example:

This example is not tested
let ui_handle = world.exec(|creator: UiCreator| {
    creator.create("renderable.ron", ())
});

Methods

impl<'a, A, I, F> UiCreator<'a, A, I, F> where
    A: Format<Audio, Options = ()> + Sync + DeserializeOwned + Clone,
    I: Format<Texture, Options = TextureMetadata> + Sync + DeserializeOwned + Clone,
    F: Format<FontAsset, Options = ()> + Sync + DeserializeOwned + Clone
[src]

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 a ron asset in the UiFormat format
  • progress: Progress tracker

Returns

The Entity that was created that will form the root of the loaded UI.

Trait Implementations

impl<'a, A, I, F> SystemData<'a> for UiCreator<'a, A, I, F> where
    A: Format<Audio, Options = ()> + Sync,
    I: Format<Texture, Options = TextureMetadata> + Sync,
    F: Format<FontAsset, Options = ()> + Sync,
    UiLoader<'a, A, I, F>: SystemData<'a>,
    Entities<'a>: SystemData<'a>,
    WriteStorage<'a, Handle<UiPrefab<A, I, F>>>: SystemData<'a>, 
[src]

Sets up the system data for fetching it from the Resources.

Fetches 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

Returns all read dependencies as fetched from Self::fetch. Read more

Returns all write dependencies as fetched from Self::fetch. Read more

Auto Trait Implementations

impl<'a, A, I, F> Send for UiCreator<'a, A, I, F>

impl<'a, A, I, F> Sync for UiCreator<'a, A, I, F>