pub struct Resources {
pub archive: Rc<Archive>,
pub sheets: Vec<LoadedSheet>,
pub fonts: Vec<LoadedFont>,
/* private fields */
}Expand description
The resource cache.
Fields§
§archive: Rc<Archive>The game’s packages.
sheets: Vec<LoadedSheet>The loaded sprite sheets.
fonts: Vec<LoadedFont>The loaded fonts.
Implementations§
Source§impl Resources
impl Resources
Sourcepub fn element(&mut self, reference: &str) -> Option<Rc<Element>>
pub fn element(&mut self, reference: &str) -> Option<Rc<Element>>
An element description by reference.
Sourcepub fn image_sheet(
&mut self,
key: &str,
width: u32,
height: u32,
rgba: Vec<u8>,
) -> SpriteRef
pub fn image_sheet( &mut self, key: &str, width: u32, height: u32, rgba: Vec<u8>, ) -> SpriteRef
A sheet with one sprite, around an image made at run time, for example a save’s preview
picture. key names it: the same key gives the same sheet, with the image it was first
made with.
Original: FUN_1400bc1b0 (a UI::SpriteSheet with AddSpriteInfo(0, 0, w, h)).
Sourcepub fn sprite(
&mut self,
sheet_ref: Option<&str>,
name: &str,
) -> Option<SpriteRef>
pub fn sprite( &mut self, sheet_ref: Option<&str>, name: &str, ) -> Option<SpriteRef>
A sprite by its sheet’s reference and its name.
Auto Trait Implementations§
impl !Send for Resources
impl !Sync for Resources
impl Freeze for Resources
impl RefUnwindSafe for Resources
impl Unpin for Resources
impl UnsafeUnpin for Resources
impl UnwindSafe for Resources
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