Struct sprite::Scene

source ·
pub struct Scene<I: ImageSize> { /* private fields */ }
Expand description

A scene is used to manage sprite’s life and run animation with sprite

Implementations

Create a new scene

Update animation’s state

Render this scene

Render this scene with tint

Register animation with sprite

Pause a running animation of the sprite

Resume a paused animation of the sprite

Toggle an animation of the sprite

Stop a running animation of the sprite

Stop all running animations of the sprite

Get all the running animations in the scene

Get the number of running animations for a sprite. If sprite does not exist, returns None.

Add sprite to scene

Remove the child by id from the scene’s children or grandchild will stop all the animations run by this child

Remove the child by id from the scene’s children or grandchild once all of its animations have finished. If the child current has no animations, it is removed immediately. Children with paused animations will not be removed until the animations are resumed and completed.

Find the child by id from the scene’s children or grandchild

Find the child by id from this sprite’s children or grandchild, mutability

Get the list of top-level (non-child) sprites.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.