Struct PropertyTargetEasingInterpolator
pub struct PropertyTargetEasingInterpolator(/* private fields */);Expand description
Use a Property Target Easing Interpolator when you want to create a smooth transition between the current value of a property and a value that you set dynamically. In a Property Target Easing Interpolator you can set the easing curve, easing mode, and the duration of the transition. When you set a property value without a Property Target Easing Interpolator, Kanzi applies the value to that property immediately. For example, when you use the Object::setProperty() function, Kanzi applies the value immediately.
Every time the value of the target property changes, Property Target Easing Interpolator starts to apply the animation from the current value of the target property to the new value of the target property. Use the setInterpolationDuration() function to set the value of the InterpolationDurationProperty property which determines the duration of the animation. The Property Target Easing Interpolator applies to the animation:
- Easing function specified by the EasingFunctionProperty property. To set the easing function, use the setEasingFunction() function.
- Easing mode specified by the EasingModeProperty property. To set the easing mode, use the setEasingMode() function.
If the value of the target property changes during an interpolating animation, the Property Target Easing Interpolator stops that animation and starts a new animation. Use the setInterpolationIfInterruptedMode() function to set the value of the InterpolationIfInterruptedModeProperty property which determines from where the animation starts:
- PropertyTargetEasingTimeline::InterpolationIfInterruptedMode::StartFromCurrentInterpolatedValue starts from the value of the target property that the previous animation reached.
- PropertyTargetEasingTimeline::InterpolationIfInterruptedMode::StartFromCurrentTargetValue starts from the previously set value of the target property.
There is no interpolation between the old and the new animations.
You can use the Property Target Easing Interpolator to interpolate properties of these data types:
- Float
- ColorRGBA and its R, G, B, and A property fields
- Vector2 and its X and Y property fields
- Vector3 and its X, Y, and Z property fields
- Vector4 and its X, Y, Z, and W property fields
- SRTValue2D and its Scale X, Scale Y, Rotation Z, Translation X, and Translation Y property fields
- SRTValue3D and its Scale X, Scale Y, Scale Z, Rotation, Translation X, Translation Y, and Translation Z property fields
§Examples
To use a Property Target Easing Interpolator to interpolate a property value:
Implementations§
§impl PropertyTargetEasingInterpolator
impl PropertyTargetEasingInterpolator
§impl PropertyTargetEasingInterpolator
impl PropertyTargetEasingInterpolator
pub fn get_enabled(&self) -> Result<bool, Error>
pub fn get_enabled(&self) -> Result<bool, Error>
See: ENABLED_PROPERTY
pub fn set_enabled(&self, value: bool) -> Result<(), Error>
pub fn set_enabled(&self, value: bool) -> Result<(), Error>
See: ENABLED_PROPERTY
pub fn get_interpolated_property_type(&self) -> Result<KanziString, Error>
pub fn get_interpolated_property_type(&self) -> Result<KanziString, Error>
pub fn get_interpolated_property_field(&self) -> Result<PropertyField, Error>
pub fn get_interpolated_property_field(&self) -> Result<PropertyField, Error>
pub fn set_interpolated_property_field(
&self,
value: PropertyField,
) -> Result<(), Error>
pub fn set_interpolated_property_field( &self, value: PropertyField, ) -> Result<(), Error>
pub fn get_interpolation_duration(&self) -> Result<i32, Error>
pub fn get_interpolation_duration(&self) -> Result<i32, Error>
pub fn set_interpolation_duration(&self, value: i32) -> Result<(), Error>
pub fn set_interpolation_duration(&self, value: i32) -> Result<(), Error>
pub fn get_easing_function(&self) -> Result<EasingFunction, Error>
pub fn get_easing_function(&self) -> Result<EasingFunction, Error>
pub fn set_easing_function(&self, value: EasingFunction) -> Result<(), Error>
pub fn set_easing_function(&self, value: EasingFunction) -> Result<(), Error>
pub fn get_easing_mode(&self) -> Result<AnimationEasingMode, Error>
pub fn get_easing_mode(&self) -> Result<AnimationEasingMode, Error>
See: EASING_MODE_PROPERTY
pub fn set_easing_mode(&self, value: AnimationEasingMode) -> Result<(), Error>
pub fn set_easing_mode(&self, value: AnimationEasingMode) -> Result<(), Error>
See: EASING_MODE_PROPERTY
pub fn get_interpolation_if_interrupted(
&self,
) -> Result<InterpolationIfInterruptedMode, Error>
pub fn get_interpolation_if_interrupted( &self, ) -> Result<InterpolationIfInterruptedMode, Error>
pub fn set_interpolation_if_interrupted(
&self,
value: InterpolationIfInterruptedMode,
) -> Result<(), Error>
pub fn set_interpolation_if_interrupted( &self, value: InterpolationIfInterruptedMode, ) -> Result<(), Error>
pub fn get_notify_interpolation_completed(&self) -> Result<bool, Error>
pub fn get_notify_interpolation_completed(&self) -> Result<bool, Error>
pub fn set_notify_interpolation_completed(
&self,
value: bool,
) -> Result<(), Error>
pub fn set_notify_interpolation_completed( &self, value: bool, ) -> Result<(), Error>
Methods from Deref<Target = NodeComponent>§
pub fn get_name(&self) -> Result<KanziString, Error>
pub fn get_name(&self) -> Result<KanziString, Error>
See: NAME_PROPERTY
pub fn get_node(&self) -> Result<Option<Weak<Node>>, Error>
pub fn get_node(&self) -> Result<Option<Weak<Node>>, Error>
Returns the node the node component is attached to
or None if node component is not attached to a node.
pub fn get_state(&self) -> Result<NodeComponentState, Error>
pub fn get_state(&self) -> Result<NodeComponentState, Error>
Gets the state of node component indicating if component is attached to a node, detached from any node or in process of attaching/detaching.
Methods from Deref<Target = Object>§
pub fn as_ptr(&self) -> *mut ObjectWrapper
pub fn as_wrapper(&self) -> &ObjectWrapper
pub fn as_object(&self) -> &Object
pub fn as_object(&self) -> &Object
Represents any type inheriting from Object as &Object.
This is useful for comparisions when PartialEq traits failed to compare objects of
different types.
let child = screen.get_child(0)?;
let parent = child.get_parent()?.into_error(ErrorKind::ObjectNotFound)?;
// assert_eq!(screen, parent); // <- Fails to compile!
assert_eq!(screen.as_object(), parent.as_object());pub fn get_native(&self) -> Result<NonNull<c_void>, Error>
pub fn get_native(&self) -> Result<NonNull<c_void>, Error>
Gets a pointer to the backing C++ instance.
pub fn get_property<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<<T as VariantConstraint>::RetArg, Error>where
T: PropertyTypeConstraint,
pub fn get_property<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<<T as VariantConstraint>::RetArg, Error>where
T: PropertyTypeConstraint,
Returns the current value of a property disregarding modifiers.
Base value is affected by the following inputs where the highest entry in the list determines the base value:
- Local value set with setProperty or loaded from kzb
- Value set by a style affecting the property.
- Value defined by class metadata.
Modifiers are not applied, the highest-priority base value is returned.
If no inputs to the property value can be established the system returns the value default value from property type metadata.
§Arguments
property_type- The property type identifying the property to retrieve.
§Returns
The evaluated property value.
pub fn get_optional_property<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<Option<<T as VariantConstraint>::RetArg>, Error>where
T: PropertyTypeConstraint,
pub fn get_optional_property<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<Option<<T as VariantConstraint>::RetArg>, Error>where
T: PropertyTypeConstraint,
Returns the current value of a property disregarding modifiers, but does not default to the value in property metadata if there are no inputs to the property value.
If there is no value sources, None is returned.
If no inputs to the property value can be established the system returns the value default value from property type metadata.
§Arguments
property_type- The property type identifying the property to retrieve.
§Returns
The evaluated property value.
pub fn set_property<T>(
&self,
property_type: &PropertyType<T>,
value: <T as VariantConstraint>::DataArg<'_>,
) -> Result<(), Error>where
T: PropertyTypeConstraint,
pub fn set_property<T>(
&self,
property_type: &PropertyType<T>,
value: <T as VariantConstraint>::DataArg<'_>,
) -> Result<(), Error>where
T: PropertyTypeConstraint,
Sets the local value of a property type.
pub fn has_value<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<bool, Error>where
T: PropertyTypeConstraint,
pub fn has_value<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<bool, Error>where
T: PropertyTypeConstraint,
Evaluates whether there are any inputs into the property value. Both value sources and modifiers are taken into account.
§Returns
Returns true if there are inputs into the property value, false otherwise.
pub fn remove_local_value<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<(), Error>where
T: PropertyTypeConstraint,
pub fn remove_local_value<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<(), Error>where
T: PropertyTypeConstraint,
Removes the local value associated with the property.
pub fn get_metaclass(&self) -> Result<Metaclass, Error>
pub fn get_metaclass(&self) -> Result<Metaclass, Error>
Returns the metaclass of the dynamic type of the object.
pub fn get_domain(&self) -> Result<Domain, Error>
pub fn get_domain(&self) -> Result<Domain, Error>
Returns the domain the object belongs to.
pub fn set_flag_keep_during_patching<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<(), Error>where
T: PropertyTypeConstraint,
pub fn set_flag_keep_during_patching<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<(), Error>where
T: PropertyTypeConstraint,
Sets the flag to indicate that the property was loaded from KZB.
pub fn debug_string(&self) -> Result<String, Error>
pub fn debug_string(&self) -> Result<String, Error>
Builds a string representation of the object intended for debugging purposes.
Trait Implementations§
§impl Clone for PropertyTargetEasingInterpolator
impl Clone for PropertyTargetEasingInterpolator
§fn clone(&self) -> PropertyTargetEasingInterpolator
fn clone(&self) -> PropertyTargetEasingInterpolator
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more