Struct amethyst_ui::UiLoader [−][src]
pub struct UiLoader<'a, I = TextureFormat, F = FontFormat> where
I: Format<Texture, Options = TextureMetadata> + Sync,
F: Format<FontAsset, Options = ()> + Sync, { /* fields omitted */ }
Specialised UI loader
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(|loader: UiLoader<TextureFormat, FontFormat>| { loader.load("renderable.ron", ()) });
Methods
impl<'a, I, F> UiLoader<'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> UiLoader<'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 load<N, P>(&self, name: N, progress: P) -> Handle<UiPrefab<I, F>> where
N: Into<String>,
P: Progress, [src]
pub fn load<N, P>(&self, name: N, progress: P) -> Handle<UiPrefab<I, F>> where
N: Into<String>,
P: Progress, Load ui from disc
Trait Implementations
impl<'a, I, F> SystemData<'a> for UiLoader<'a, I, F> where
I: Format<Texture, Options = TextureMetadata> + Sync,
F: Format<FontAsset, Options = ()> + Sync,
ReadExpect<'a, Loader>: SystemData<'a>,
Read<'a, AssetStorage<UiPrefab<I, F>>>: SystemData<'a>, [src]
impl<'a, I, F> SystemData<'a> for UiLoader<'a, I, F> where
I: Format<Texture, Options = TextureMetadata> + Sync,
F: Format<FontAsset, Options = ()> + Sync,
ReadExpect<'a, Loader>: SystemData<'a>,
Read<'a, AssetStorage<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