Struct components::engine::d2::platform::BasicAssetPack
source · [−]pub struct BasicAssetPack {
pub loader: Rc<BasicAssetPackLoader>,
pub textures: HashMap<String, Rc<dyn Texture + 'static>, RandomState>,
pub sounds: HashMap<String, Rc<dyn Sound + 'static>, RandomState>,
pub files: HashMap<String, Rc<dyn File + 'static>, RandomState>,
pub disposed: bool,
/* private fields */
}
Fields
loader: Rc<BasicAssetPackLoader>
textures: HashMap<String, Rc<dyn Texture + 'static>, RandomState>
sounds: HashMap<String, Rc<dyn Sound + 'static>, RandomState>
files: HashMap<String, Rc<dyn File + 'static>, RandomState>
disposed: bool
Implementations
sourceimpl BasicAssetPack
impl BasicAssetPack
pub fn new(
manifest: Manifest,
loader: Rc<BasicAssetPackLoader>
) -> BasicAssetPack
Trait Implementations
sourceimpl AssetPack for BasicAssetPack
impl AssetPack for BasicAssetPack
sourcefn texture(
&self,
name: String,
required: bool
) -> Option<Rc<dyn Texture + 'static>>
fn texture(
&self,
name: String,
required: bool
) -> Option<Rc<dyn Texture + 'static>>
The manifest that was used to load this asset pack. Gets a texture by name from the asset pack. The name must NOT contain a filename extension. Textures are cached, so it’s safe to get the same texture multiple times. @param required If true and the asset was not found, an error is thrown. Read more
sourcefn sound(&self, name: String, required: bool) -> Option<Rc<dyn Sound + 'static>>
fn sound(&self, name: String, required: bool) -> Option<Rc<dyn Sound + 'static>>
Gets a sound by name from the asset pack. The name must NOT contain a filename extension. Sounds are cached, so it’s safe to get the same sound multiple times. @param required If true and the asset was not found, an error is thrown. Read more
sourcefn file(&self, name: String, required: bool) -> Option<Rc<dyn File + 'static>>
fn file(&self, name: String, required: bool) -> Option<Rc<dyn File + 'static>>
Gets a file by name from the asset pack, returning its raw content. Files are cached, so it’s safe to get the same file multiple times. @param required If true and the asset was not found, an error is thrown. Read more
sourceimpl Disposable for BasicAssetPack
impl Disposable for BasicAssetPack
Auto Trait Implementations
impl !RefUnwindSafe for BasicAssetPack
impl !Send for BasicAssetPack
impl !Sync for BasicAssetPack
impl Unpin for BasicAssetPack
impl !UnwindSafe for BasicAssetPack
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
fn into_color(self) -> To
fn into_color(self) -> To
Convert into color
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
Sets value
as a parameter of self
.