pub struct Assets {
pub asset_loader: AssetLoader,
pub textures: HashMap<String, TextureHandle>,
pub texture_image_map: Arc<Mutex<HashMap<TextureHandle, Arc<RgbaImage>>>>,
pub sound_ids: HashMap<String, Sound>,
pub sounds: Arc<Mutex<HashMap<Sound, StaticSoundData>>>,
pub sound_handles: HashMap<Sound, StaticSoundHandle>,
pub fonts: HashMap<FontHandle, Font>,
pub sound_groups: HashMap<String, Vec<Sound>>,
}
Fields§
§asset_loader: AssetLoader
§textures: HashMap<String, TextureHandle>
§texture_image_map: Arc<Mutex<HashMap<TextureHandle, Arc<RgbaImage>>>>
§sound_ids: HashMap<String, Sound>
§sounds: Arc<Mutex<HashMap<Sound, StaticSoundData>>>
§sound_handles: HashMap<Sound, StaticSoundHandle>
§fonts: HashMap<FontHandle, Font>
§sound_groups: HashMap<String, Vec<Sound>>
Implementations§
Source§impl Assets
impl Assets
pub fn new() -> Self
pub fn load_font(&mut self, font: Font) -> FontHandle
pub fn load_sound_from_bytes( &mut self, name: &str, bytes: &[u8], settings: StaticSoundSettings, )
pub fn process_asset_queues(&mut self)
pub fn handle_name(handle: TextureHandle) -> Option<String>
pub fn insert_handle(&mut self, name: &str, handle: TextureHandle)
pub fn get_texture(&self, key: &str) -> TextureHandle
pub fn image_size(handle: TextureHandle) -> ImageSizeResult
pub fn load_image_data( path: &str, texture: TextureHandle, ) -> Option<Arc<RgbaImage>>
pub fn error_loading_image(path: &str)
Auto Trait Implementations§
impl Freeze for Assets
impl !RefUnwindSafe for Assets
impl Send for Assets
impl Sync for Assets
impl Unpin for Assets
impl !UnwindSafe for Assets
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more