TimedAnimation
Superclasses: Animation
, Object
A time-based Animation
.
AdwTimedAnimation
implements a simple animation interpolating the given
value from value_from
to
value_to
over
duration
milliseconds using the curve described by
easing
.
If reverse
is set to TRUE
, AdwTimedAnimation
will instead animate from value_to
to
value_from
, and the easing curve will be inverted.
The animation can repeat a certain amount of times, or endlessly, depending
on the repeat_count
value. If
alternate
is set to TRUE
, it will also change the
direction every other iteration.
Constructors
- class TimedAnimation
- classmethod new(widget: Widget, from_: float, to: float, duration: int, target: AnimationTarget) Animation
Creates a new
AdwTimedAnimation
onwidget
to animatetarget
fromfrom
toto
.- Parameters:
widget – a widget to create animation on
from
to – a value to animate to
duration – a duration for the animation
target – a target value to animate
Methods
- class TimedAnimation
-
- set_alternate(alternate: bool) None
Sets whether
self
changes direction on every iteration.- Parameters:
alternate – whether
self
alternates
- set_duration(duration: int) None
Sets the duration of
self
.If the animation repeats more than once, sets the duration of one iteration.
- Parameters:
duration – the duration to use, in milliseconds
- set_easing(easing: Easing) None
Sets the easing function
self
will use.See
Easing
for the description of specific easing functions.- Parameters:
easing – the easing function to use
- set_repeat_count(repeat_count: int) None
Sets the number of times
self
will play.If set to 0,
self
will repeat endlessly.- Parameters:
repeat_count – the number of times
self
will play
- set_reverse(reverse: bool) None
Sets whether
self
plays backwards.- Parameters:
reverse – whether
self
plays backwards
- set_value_from(value: float) None
Sets the value
self
will animate from.The animation will start at this value and end at
value_to
.If
reverse
isTRUE
, the animation will end at this value instead.- Parameters:
value – the value to animate from
- set_value_to(value: float) None
Sets the value
self
will animate to.The animation will start at
value_from
and end at this value.If
reverse
isTRUE
, the animation will start at this value instead.- Parameters:
value – the value to animate to
Properties
- class TimedAnimation
-
- props.duration: int
Duration of the animation, in milliseconds.
Describes how much time the animation will take.
If the animation repeats more than once, describes the duration of one iteration.
- props.easing: Easing
Easing function used in the animation.
Describes the curve the value is interpolated on.
See
Easing
for the description of specific easing functions.
- props.repeat_count: int
Number of times the animation will play.
If set to 0, the animation will repeat endlessly.
- props.value_from: float
The value to animate from.
The animation will start at this value and end at
value_to
.If
reverse
isTRUE
, the animation will end at this value instead.
- props.value_to: float
The value to animate to.
The animation will start at
value_from
and end at this value.If
reverse
isTRUE
, the animation will start at this value instead.