pub struct Context { /* private fields */ }Expand description
Bundle of a Packer and a Dictionary
Implementations
sourceimpl Context
impl Context
sourcepub fn pack(&mut self, path: &PathBuf, gap: u32) -> Option<Rect>
pub fn pack(&mut self, path: &PathBuf, gap: u32) -> Option<Rect>
Packs image loaded from the provided path into the packer with the provided gap and
records it into the dictionary. Returns the rect the texture was packed in if successful
sourcepub fn save_to_file(
&self,
name: &str,
image: ImageFormat,
dict: Option<DictionaryFormat>
) -> Result<()>
pub fn save_to_file(
&self,
name: &str,
image: ImageFormat,
dict: Option<DictionaryFormat>
) -> Result<()>
Saves both the packer and the dictionary to a file with given name, image format and
dictionary format. If dictionary is None then the dictionary is not serialized
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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