pub struct Library {
pub frame_rate: f32,
/* private fields */
}
Expand description
An exported Flump library containing movies and bitmaps.
Fields
frame_rate: f32
The original frame rate of movies in this library.
Implementations
sourceimpl Library
impl Library
sourcepub fn new(pack: impl AssetPack, base_dir: String) -> Library
pub fn new(pack: impl AssetPack, base_dir: String) -> Library
Creates a library using files in an AssetPack. @param baseDir The directory in the pack containing Flump’s library.json and texture atlases.
sourcepub fn from_flipbooks(flipbooks: Vec<Flipbook, Global>) -> Library
pub fn from_flipbooks(flipbooks: Vec<Flipbook, Global>) -> Library
Creates a library procedurally using a set of Flipbook definitions. Each flipbook will be
converted to a movie that can be instanciated with createMovie()
.
*
sourcepub fn dispose_files(&self) -> &Library
pub fn dispose_files(&self) -> &Library
Disposes the source library.json File used to create this Library. This can free up some memory, if you don’t intend to recreate this Library later from the same AssetPack.
@returns This instance, for chaining.
sourcepub fn symbol(
&self,
symbol_name: String
) -> Option<&Rc<dyn Symbol<MovieSprite> + 'static>>
pub fn symbol(
&self,
symbol_name: String
) -> Option<&Rc<dyn Symbol<MovieSprite> + 'static>>
Retrieve a name symbol from this library, or None if not found.
sourcepub fn create_sprite(
&self,
symbol_name: String,
required: bool
) -> Option<Sprite>
pub fn create_sprite(
&self,
symbol_name: String,
required: bool
) -> Option<Sprite>
Creates a sprite from a symbol name, it’ll either be a movie or a bitmap. @param required If true and the symbol is not in this library, an error is thrown.
sourcepub fn create_movie(
&self,
symbol_name: String,
required: bool
) -> Option<MovieSprite>
pub fn create_movie(
&self,
symbol_name: String,
required: bool
) -> Option<MovieSprite>
Creates a movie sprite from a symbol name. @param required If true and the symbol is not in this library, an error is thrown.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Library
impl !Send for Library
impl !Sync for Library
impl Unpin for Library
impl !UnwindSafe for Library
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
.