pub struct Module { /* private fields */ }Expand description
A module containing sprites
Implementations§
Source§impl Module
impl Module
Sourcepub fn new<R, S, T>(name: R, sprite_paths: S, submodules: T) -> Self
pub fn new<R, S, T>(name: R, sprite_paths: S, submodules: T) -> Self
Create a module from its name, its sprite paths, and its submodules
Sourcepub fn parse(self) -> Result<ParsedModule, PngToWasm4SrcError>
pub fn parse(self) -> Result<ParsedModule, PngToWasm4SrcError>
Parse the sprites in the module
Parse all the sprites in the module and generate their Rust variables.
Sourcepub fn flatten(self) -> Self
pub fn flatten(self) -> Self
Flatten the module
Flatten the module so that all sprites are defined in the top-level module.
Sourcepub fn generate_cargo_build_instructions<W>(
&self,
output: &mut W,
) -> Result<(), Error>where
W: Write,
pub fn generate_cargo_build_instructions<W>(
&self,
output: &mut W,
) -> Result<(), Error>where
W: Write,
Generate instructions for cargo build
Build scripts communicate with cargo by printing instructions starting
with cargo: to standard output.
This function generates a list of instructions to force a rebuild when
source PNGs are modified.
Trait Implementations§
Source§impl Ord for Module
impl Ord for Module
Source§impl PartialOrd for Module
impl PartialOrd for Module
impl Eq for Module
impl StructuralPartialEq for Module
Auto Trait Implementations§
impl Freeze for Module
impl RefUnwindSafe for Module
impl Send for Module
impl Sync for Module
impl Unpin for Module
impl UnwindSafe for Module
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