Class: Yuki::Animation::TimedAnimation
- Defined in:
- docs/4_Systems_005_Animation.rb
Overview
Class calculating time offset for animation.
This class also manage parallel & sub animation. Example :
(TimedAnimation.new(1) | TimedAnimation.new(2) > TimedAnimation.new(3)).root
# Is equivalent to
TimedAnimation.new(1).parallel_play(TimedAnimation.new(2)).play_before(TimedAnimation.new(3)).root
# Which is equivalent to : play 1 & 2 in parallel and then play 3
# Note that if 2 has sub animation, its sub animation has to finish in order to see animation 3
Direct Known Subclasses
Battle::Visual::FakeHPAnimation, Command, Dim2Animation, Dim2AnimationDiscreet, DiscreetAnimation, FullyResolvedAnimation, MessageLocked, ScalarAnimation, SpriteSheetAnimation, TimedLoopAnimation
Instance Attribute Summary collapse
-
#begin_time ⇒ Time?
readonly
Get the begin time of the animation (if started).
-
#end_time ⇒ Time?
readonly
Get the end time of the animation (if started).
-
#parallel_animations ⇒ Array<TimedAnimation>
readonly
Animation playing in parallel.
-
#root ⇒ TimedAnimation
The root animation (to retreive the right animation to play when building animation using operators).
-
#sub_animation ⇒ TimedAnimation?
readonly
Animation that plays after.
-
#time_source ⇒ #call?
readonly
Get the time source of the animation (if started).
Instance Method Summary collapse
-
#done? ⇒ Boolean
Indicate if the animation is done.
-
#in_parallel_of(other) ⇒ TimedAnimation
(also: #>>)
Add this animation in parallel of another animation.
-
#initialize(time_to_process, distortion = :UNICITY_DISTORTION, time_source = :GENERIC_TIME_SOURCE) ⇒ TimedAnimation
constructor
Create a new TimedAnimation.
-
#parallel_add(other) ⇒ self
(also: #<<, #|, #parallel_play)
Add a parallel animation.
-
#play_before(other) ⇒ TimedAnimation
(also: #>)
Add a sub animation.
-
#resolver=(resolver)
Define the resolver (and transmit it to all the childs / parallel).
-
#start(begin_offset = 0)
Start the animation (initialize it).
-
#update
Update the animation internal time and call update_internal with a parameter between 0 & 1 indicating the progression of the animation.
Constructor Details
#initialize(time_to_process, distortion = :UNICITY_DISTORTION, time_source = :GENERIC_TIME_SOURCE) ⇒ TimedAnimation
Create a new TimedAnimation
47 48 |
# File 'docs/4_Systems_005_Animation.rb', line 47 def initialize(time_to_process, distortion = :UNICITY_DISTORTION, time_source = :GENERIC_TIME_SOURCE) end |
Instance Attribute Details
#begin_time ⇒ Time? (readonly)
Get the begin time of the animation (if started)
35 36 37 |
# File 'docs/4_Systems_005_Animation.rb', line 35 def begin_time @begin_time end |
#end_time ⇒ Time? (readonly)
Get the end time of the animation (if started)
38 39 40 |
# File 'docs/4_Systems_005_Animation.rb', line 38 def end_time @end_time end |
#parallel_animations ⇒ Array<TimedAnimation> (readonly)
Returns animation playing in parallel.
27 28 29 |
# File 'docs/4_Systems_005_Animation.rb', line 27 def parallel_animations @parallel_animations end |
#root ⇒ TimedAnimation
Returns the root animation (to retreive the right animation to play when building animation using operators).
32 33 34 |
# File 'docs/4_Systems_005_Animation.rb', line 32 def root @root end |
#sub_animation ⇒ TimedAnimation? (readonly)
Returns animation that plays after.
29 30 31 |
# File 'docs/4_Systems_005_Animation.rb', line 29 def sub_animation @sub_animation end |
#time_source ⇒ #call? (readonly)
Get the time source of the animation (if started)
41 42 43 |
# File 'docs/4_Systems_005_Animation.rb', line 41 def time_source @time_source end |
Instance Method Details
#done? ⇒ Boolean
should always be called after start
Indicate if the animation is done
56 57 |
# File 'docs/4_Systems_005_Animation.rb', line 56 def done? end |
#in_parallel_of(other) ⇒ TimedAnimation Also known as: >>
Add this animation in parallel of another animation
74 75 |
# File 'docs/4_Systems_005_Animation.rb', line 74 def in_parallel_of(other) end |
#parallel_add(other) ⇒ self Also known as: <<, |, parallel_play
Add a parallel animation
66 67 |
# File 'docs/4_Systems_005_Animation.rb', line 66 def parallel_add(other) end |
#play_before(other) ⇒ TimedAnimation Also known as: >
Add a sub animation
80 81 |
# File 'docs/4_Systems_005_Animation.rb', line 80 def play_before(other) end |
#resolver=(resolver)
Define the resolver (and transmit it to all the childs / parallel)
85 86 |
# File 'docs/4_Systems_005_Animation.rb', line 85 def resolver=(resolver) end |
#start(begin_offset = 0)
Start the animation (initialize it)
51 52 |
# File 'docs/4_Systems_005_Animation.rb', line 51 def start(begin_offset = 0) end |
#update
should always be called after start
Update the animation internal time and call update_internal with a parameter between 0 & 1 indicating the progression of the animation
61 62 |
# File 'docs/4_Systems_005_Animation.rb', line 61 def update end |