Trait AnimatableExt

Source
pub trait AnimatableExt: 'static {
    // Required methods
    fn find_property(&self, property_name: &str) -> Option<ParamSpec>;
    fn get_initial_state(&self, property_name: &str, value: &mut Value);
    fn interpolate_value<P: IsA<Interval>>(
        &self,
        property_name: &str,
        interval: &P,
        progress: f64,
    ) -> Option<Value>;
    fn set_final_state(&self, property_name: &str, value: &Value);
}
Expand description

Trait containing all Animatable methods.

§Implementors

Actor, Animatable, Box, Clone, Group, Rectangle, ScrollActor, Stage, Text, Texture

Required Methods§

Source

fn find_property(&self, property_name: &str) -> Option<ParamSpec>

Finds the gobject::ParamSpec for property_name

§property_name

the name of the animatable property to find

§Returns

The gobject::ParamSpec for the given property or None

Source

fn get_initial_state(&self, property_name: &str, value: &mut Value)

Retrieves the current state of property_name and sets value with it

§property_name

the name of the animatable property to retrieve

§value

a gobject::Value initialized to the type of the property to retrieve

Source

fn interpolate_value<P: IsA<Interval>>( &self, property_name: &str, interval: &P, progress: f64, ) -> Option<Value>

Asks a Animatable implementation to interpolate a a named property between the initial and final values of a Interval, using progress as the interpolation value, and store the result inside value.

This function should be used for every property animation involving Animatables.

This function replaces Animatable::animate_property.

§property_name

the name of the property to interpolate

§interval

a Interval with the animation range

§progress

the progress to use to interpolate between the initial and final values of the interval

§value

return location for an initialized gobject::Value using the same type of the interval

§Returns

true if the interpolation was successful, and false otherwise

Source

fn set_final_state(&self, property_name: &str, value: &Value)

Sets the current state of property_name to value

§property_name

the name of the animatable property to set

§value

the value of the animatable property to set

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§