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 State
s is with world.exec
.
Type parameters:
I
:Format
used for loadingTexture
sF
:Format
used for loadingFontAsset
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]
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,
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 aron
asset in theUiFormat
formatprogress
: 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]
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>,
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) -> Self
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
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