pub struct Module { /* private fields */ }Expand description
A component of a Storyboard
Storyboards, in osb, are split into different components called Modules. This allows the
storyboarder to have the good practice of splitting a Storyboard into different parts
efficiently.
In terms of scalabitily, this allows anyone to create, share and import Modules of any
kind. Everyone can publish their own Module to crates.io and anyone can use them.
This forces the storyboarder to initialize and push Modules properly onto their
Storyboards. It is recommended to create a function for each new Module or create a file
of its own depending on the complexity of your module.
A Module is tied to a Layer and cannot be changed.
Implementations§
Source§impl Module
impl Module
Sourcepub fn push(&mut self, sprite: Sprite)
pub fn push(&mut self, sprite: Sprite)
Adds a Sprite to a Module
Usage:
use osb::{Layer, Module, Sprite};
let mut module = Module::new(Layer::Background);
let mut sprite = Sprite::new("res/sprite.png");
module.push(sprite);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