pub struct Stage {
pub variables: HashMap<String, Variable>,
pub lists: HashMap<String, List>,
pub broadcasts: Vec<Broadcast>,
pub scripts: Vec<Script>,
pub current_backdrop: usize,
pub sounds: HashMap<String, Sound>,
pub volume: f32,
/* private fields */
}Expand description
The Stage struct represents the stage in a Scratch 3.0 project.
Fields§
§variables: HashMap<String, Variable>Contains all the global variables in the project.
lists: HashMap<String, List>§broadcasts: Vec<Broadcast>Contains all the broadcasts in the project.
scripts: Vec<Script>Contains all the scripts in the stage.
current_backdrop: usizeThe index of the current backdrop.
sounds: HashMap<String, Sound>Contains all the sounds of the stage.
volume: f32The stage’s volume (0.0 = 0%, 1.0 = 100%)
Implementations§
Source§impl Stage
impl Stage
Sourcepub fn new(
raw: RawStage,
zip: &mut ZipArchive<Cursor<Vec<u8>>>,
) -> Result<Self, DecodeError>
pub fn new( raw: RawStage, zip: &mut ZipArchive<Cursor<Vec<u8>>>, ) -> Result<Self, DecodeError>
Returns a new stage from a RawStage and the zip archive.
Sourcepub fn get_backdrop(&self, name: &str) -> Option<&Costume>
pub fn get_backdrop(&self, name: &str) -> Option<&Costume>
Returns a reference to a backdrop by its name, if it exists.
Sourcepub fn get_backdrop_mut(&mut self, name: &str) -> Option<&mut Costume>
pub fn get_backdrop_mut(&mut self, name: &str) -> Option<&mut Costume>
Returns a mutable reference to a backdrop by its name, if it exists.
Sourcepub fn backdrop_names(&self) -> Vec<&String>
pub fn backdrop_names(&self) -> Vec<&String>
Returns all the backdrop names in the stage.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Stage
impl RefUnwindSafe for Stage
impl Send for Stage
impl Sync for Stage
impl Unpin for Stage
impl UnwindSafe for Stage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more