efl/src/lib/evas/canvas/efl_canvas_animation.eo

107 lines
3.6 KiB
Plaintext
Raw Normal View History

import efl_canvas_animation_types;
class @beta Efl.Canvas.Animation extends Efl.Object implements Efl.Playable
{
[[Base class to be used by classes implementing specific canvas animations.
A canvas animation modifies the properties of a @Efl.Canvas.Object like
@Efl.Gfx.Entity.position, @Efl.Gfx.Entity.scale or @Efl.Gfx.Mapping.rotate, for example.
The value of the changed properties moves smoothly as the provided progress value
evolves from $[0] to $[1].
For example implementations see @Efl.Canvas.Animation_Translate or @Efl.Canvas.Animation_Scale.
]]
c_prefix: efl_animation;
methods {
@property final_state_keep {
[[If $true the last mapping state the animation applies will be kept.
Otherwise all the @Efl.Gfx.Mapping properties will be reset when the animation ends.]]
set {
}
get {
}
values {
keep: bool; [[$true to keep the final state.]]
}
}
@property duration {
[[The duration of a single animation "run".
The @Efl.Playable.length implementation will return this duration adjusted by @.repeat_mode and
@.repeat_count.
]]
set {
}
get {
}
values {
sec: double; [[Duration in seconds.]]
}
}
@property repeat_mode {
[[What to do when the animation finishes.
]]
set {
}
get {
}
values {
mode: Efl.Canvas.Animation_Repeat_Mode(Efl.Canvas.Animation_Repeat_Mode.restart); [[Repeat mode.]]
}
}
@property repeat_count {
[[How many times to repeat an animation once it finishes.
$[0] means that the animation only plays once (it is not repeated) and is the default value.
$[-1] means that the animation is repeated forever.
]]
values {
count: int(0); [[Repeat count.]]
}
}
@property start_delay {
[[The time that passes since the animation is started and the first real change to the object is applied.
]]
set {
}
get {
}
values {
sec: double; [[Delay time in seconds.]]
}
}
@property interpolator {
[[Optional mapping function.
Animations are based on a timer that moves linearly from 0 to 1. This $interpolator
method is applied before the timer is passed to the animation, to achieve effects
like acceleration or deceleration, for example.
]]
set {
}
get {
}
values {
interpolator: Efl.Interpolator; [[Mapping function. By default it is $NULL (linear mapping).]]
}
}
animation_apply {
[[Overwrite this method to implement your own animation subclasses.
This is used for example by @Efl.Canvas.Animation_Translate or @Efl.Canvas.Animation_Scale.
Subclasses should call their parent's @.animation_apply to get the adjusted $progress value
and then perform the animation by modifying the $target's properties.
]]
params {
@in progress: double; [[Animation progress from $[0] to $[1].]]
@in target: Efl.Canvas.Object; [[Object to animate.]]
}
return: double; [[Final applied progress, after possible adjustments. See @.interpolator.]]
}
}
implements {
Efl.Playable.length { get; }
Efl.Playable.seekable { get; }
Efl.Playable.playable { get; }
}
}