Class: Yuki::Animation::EqAnimation
- Inherits:
-
TimedAnimation
- Object
- TimedAnimation
- Yuki::Animation::EqAnimation
- Includes:
- Math
- Defined in:
- docs/4_Systems_005_Animation.rb
Overview
Class applying equation to sprite property using defined equation.
Equations are named and all their parameter is given by a hash. You can apply equations on several properties of the sprite.
Here's the name of the equations and their parameters:
:linear=>a * t + b:quadratic=>a * t² + b * t + c:cosine=>a * cos(2pi * f * t + phi) + b:variable_cosine=>(a * cos(2pi * f2 * t + phi2) + b) * cos(2pi * f * t + phi) + c
Note: t ∈ [0, 1]
Equations may be expressed this way: `[[:property1, :equation_name, { **params }], [:property2, :equation_name, { **params }]]``
Direct Known Subclasses
Defined Under Namespace
Modules: Offset
Constant Summary collapse
- SPRITE_PROPERTY_TO_SETTER =
Constant mapping properties to their setter method
{x: :x=, y: :y=, z: :z=, ox: :ox=, oy: :oy=, angle: :angle=, opacity: :opacity=}
- TWO_PI =
Constant representing 2π
2 * PI
Instance Attribute Summary
Attributes inherited from TimedAnimation
#begin_time, #end_time, #time_source
Attributes included from Yuki::AnimationMixin
Instance Method Summary collapse
-
#initialize(time_to_process, on, equations, distortion: :UNICITY_DISTORTION, time_source: :SCENE_TIME_SOURCE) ⇒ EqAnimation
constructor
Create a new EqAnimation animation convert it to another number (between 0 & 1) in order to distord time.
-
#start(begin_offset = 0) ⇒ self
Start the animation (initialize it).
Methods inherited from TimedAnimation
#done?, #duration, #parallel_add, #play_before, #update
Methods included from Yuki::AnimationMixin
#begin_offset_for_next_animation, #done?, #duration, #update
Constructor Details
#initialize(time_to_process, on, equations, distortion: :UNICITY_DISTORTION, time_source: :SCENE_TIME_SOURCE) ⇒ EqAnimation
Create a new EqAnimation animation convert it to another number (between 0 & 1) in order to distord time
1132 1133 |
# File 'docs/4_Systems_005_Animation.rb', line 1132 def initialize(time_to_process, on, equations, distortion: :UNICITY_DISTORTION, time_source: :SCENE_TIME_SOURCE) end |
Instance Method Details
#start(begin_offset = 0) ⇒ self
Start the animation (initialize it)
1137 1138 |
# File 'docs/4_Systems_005_Animation.rb', line 1137 def start(begin_offset = 0) end |