pub struct SceneManager { /* private fields */ }Expand description
Manages scene registration, transitions, and lifecycle.
Implementations§
Source§impl SceneManager
Implements static scene creation for SceneManager.
impl SceneManager
Implements static scene creation for SceneManager.
Source§impl SceneManager
Implements scene registration and lifecycle management for SceneManager.
impl SceneManager
Implements scene registration and lifecycle management for SceneManager.
Sourcepub fn register(&mut self, name: String, scene: SceneRc)
pub fn register(&mut self, name: String, scene: SceneRc)
Registers a scene under the given name.
§Arguments
String- The name to register the scene under.SceneRc- The scene to register.
Sourcepub fn unregister(&mut self, name: &str)
pub fn unregister(&mut self, name: &str)
Unregisters and removes the scene with the given name.
§Arguments
&str- The name of the scene to remove.
Sourcepub fn request_transition(&mut self, name: String)
pub fn request_transition(&mut self, name: String)
Requests a deferred scene transition to be applied on the next update.
§Arguments
String- The name of the scene to switch to.
Sourcepub fn process_pending_transition(&mut self)
pub fn process_pending_transition(&mut self)
Processes a pending scene transition if one was requested.
Sourcepub fn render(&self, context: &CanvasRenderingContext2d)
pub fn render(&self, context: &CanvasRenderingContext2d)
Calls on_render on the current scene.
§Arguments
&CanvasRenderingContext2d- The canvas rendering context.
Sourcepub fn current_name(&self) -> Option<&str>
pub fn current_name(&self) -> Option<&str>
Returns the name of the currently active scene.
§Returns
Option<&str>- The current scene name, orNone.
Source§impl SceneManager
impl SceneManager
Trait Implementations§
Source§impl Clone for SceneManager
impl Clone for SceneManager
Source§fn clone(&self) -> SceneManager
fn clone(&self) -> SceneManager
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for SceneManager
Implements Default for SceneManager as a new empty manager.
impl Default for SceneManager
Implements Default for SceneManager as a new empty manager.
Source§fn default() -> SceneManager
fn default() -> SceneManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for SceneManager
impl !Send for SceneManager
impl !Sync for SceneManager
impl !UnwindSafe for SceneManager
impl Freeze for SceneManager
impl Unpin for SceneManager
impl UnsafeUnpin for SceneManager
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