Class: WSLight::Animation::BaseAnimation
- Inherits:
-
Object
- Object
- WSLight::Animation::BaseAnimation
- Defined in:
- lib/ws_light/animation/base_animation.rb
Overview
Base class for all animations, defines common methods
Direct Known Subclasses
Instance Attribute Summary collapse
-
#set_from ⇒ Object
Returns the value of attribute set_from.
-
#set_to ⇒ Object
Returns the value of attribute set_to.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #frame_data(count) ⇒ Object
- #frames_per_second ⇒ Object
-
#initialize(set_from, set_to) ⇒ BaseAnimation
constructor
A new instance of BaseAnimation.
Constructor Details
#initialize(set_from, set_to) ⇒ BaseAnimation
Returns a new instance of BaseAnimation.
7 8 9 10 |
# File 'lib/ws_light/animation/base_animation.rb', line 7 def initialize(set_from, set_to) @set_from = set_from @set_to = set_to end |
Instance Attribute Details
#set_from ⇒ Object
Returns the value of attribute set_from.
5 6 7 |
# File 'lib/ws_light/animation/base_animation.rb', line 5 def set_from @set_from end |
#set_to ⇒ Object
Returns the value of attribute set_to.
5 6 7 |
# File 'lib/ws_light/animation/base_animation.rb', line 5 def set_to @set_to end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/ws_light/animation/base_animation.rb', line 5 def type @type end |
Instance Method Details
#frame_data(count) ⇒ Object
12 13 14 |
# File 'lib/ws_light/animation/base_animation.rb', line 12 def frame_data(count) frame(count).collect{|color| color.to_a}.flatten end |
#frames_per_second ⇒ Object
16 17 18 |
# File 'lib/ws_light/animation/base_animation.rb', line 16 def frames_per_second 25.0 end |