Class
AdapSpringAnimation
since: 1
Description [src]
final class Adap.SpringAnimation : Adap.Animation
{
/* No available fields */
}
A spring-based AdapAnimation
.
AdapSpringAnimation
implements an animation driven by a physical model of a
spring described by AdapSpringParams
, with a resting position in
AdapSpringAnimation:value-to
, stretched to
AdapSpringAnimation:value-from
.
Since the animation is physically simulated, spring animations don’t have a
fixed duration. The animation will stop when the simulated spring comes to a
rest - when the amplitude of the oscillations becomes smaller than
AdapSpringAnimation:epsilon
, or immediately when it reaches
AdapSpringAnimation:value-to
if
AdapSpringAnimation:clamp
is set to TRUE
. The estimated duration can
be obtained with AdapSpringAnimation:estimated-duration
.
Due to the nature of spring-driven motion the animation can overshoot
AdapSpringAnimation:value-to
before coming to a rest. Whether the
animation will overshoot or not depends on the damping ratio of the spring.
See AdapSpringParams
for more information about specific damping ratio values.
If AdapSpringAnimation:clamp
is TRUE
, the animation will abruptly
end as soon as it reaches the final value, preventing overshooting.
Animations can have an initial velocity value, set via
AdapSpringAnimation:initial-velocity
, which adjusts the curve without
changing the duration. This makes spring animations useful for deceleration
at the end of gestures.
If the initial and final values are equal, and the initial velocity is not 0, the animation value will bounce and return to its resting position.
Available since: 1
Instance methods
adap_spring_animation_get_estimated_duration
Gets the estimated duration of self
, in milliseconds.
since: 1
adap_spring_animation_get_spring_params
Gets the physical parameters of the spring of self
.
since: 1
adap_spring_animation_set_spring_params
Sets the physical parameters of the spring of self
.
since: 1
Methods inherited from AdapAnimation (12)
adap_animation_get_follow_enable_animations_setting
Gets whether self
should be skipped when animations are globally disabled.
since: 1.3
adap_animation_get_state
Gets the current value of self
.
since: 1
adap_animation_get_target
Gets the target self
animates.
since: 1
adap_animation_get_value
Gets the current value of self
.
since: 1
adap_animation_get_widget
Gets the widget self
was created for.
since: 1
adap_animation_pause
Pauses a playing animation for self
.
since: 1
adap_animation_play
Starts the animation for self
.
since: 1
adap_animation_reset
Resets the animation for self
.
since: 1
adap_animation_resume
Resumes a paused animation for self
.
since: 1
adap_animation_set_follow_enable_animations_setting
Sets whether to skip self
when animations are globally disabled.
since: 1.3
adap_animation_set_target
Sets the target self
animates to target
.
since: 1
adap_animation_skip
Skips the animation for self
.
since: 1
Properties
Adap.SpringAnimation:estimated-duration
Estimated duration of the animation, in milliseconds.
since: 1
Properties inherited from AdapAnimation (5)
Adap.Animation:follow-enable-animations-setting
Whether to skip the animation when animations are globally disabled.
since: 1.3
Adap.Animation:state
The animation state.
since: 1
Adap.Animation:target
The target to animate.
since: 1
Adap.Animation:value
The current value of the animation.
since: 1
Adap.Animation:widget
The animation widget.
since: 1
Signals
Signals inherited from AdapAnimation (1)
AdapAnimation::done
This signal is emitted when the animation has been completed, either on its
own or via calling adap_animation_skip()
.
since: 1
Signals inherited from GObject (1)
GObject::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.
unstable since: 2.0