logo
pub struct MoviePlayer {
    pub inner: Component,
    pub movie: Option<MovieSprite>,
    pub looping: bool,
    /* private fields */
}
Expand description

A convenient controller to play though multiple different movies. Designed for characters and objects that have a separate Flump symbol for each of their animations, and need to switch between them. The played movies will be added to a new child entity of the owner.

Fields

inner: Componentmovie: Option<MovieSprite>

The movie currently being shown.

looping: bool

Whether the current movie is being looped.

Implementations

Configures whether this MoviePlayer will keep a cache of all its MovieSprites, rather than creating a new instance for each play. This makes switching movies faster, at the expense of memory. By default, the cache is enabled. If this MoviePlayer plays lots of different movies, but doesn’t match through them too often, consider disabling the cache. @returns This instance, for chaining.

Configures the callback used to decorate newly created MovieSprites, if any. This can be used to dress up avatars or other custom initialization. @returns This instance, for chaining.

Shows a movie that plays once. When it completes, the last looping movie is returned to. It is an error to call this without starting a loop() first. @param name The symbol name of the movie to play. @param restart If this movie is already being played, whether it will restart it from the beginning. @returns This instance, for chaining.

Shows a movie that loops forever. @param name The symbol name of the movie to loop. @param restart If this movie is already being looped, whether it will restart it from the beginning. @returns This instance, for chaining.

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.

Converts this type into a shared reference of the (usually inferred) input type.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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.

Typed getter

Inspect the context.

Inspect the context.

Inspect the context.

Calls U::from(self).

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

Convert into color

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Sets value as a parameter of self.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

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.