Class: WSLight::Animation::BaseAnimation

Inherits:
Object
  • Object
show all
Defined in:
lib/ws_light/animation/base_animation.rb

Overview

Base class for all animations, defines common methods

Instance Attribute Summary collapse

Instance Method Summary collapse

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_fromObject

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_toObject

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

#typeObject

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_secondObject



16
17
18
# File 'lib/ws_light/animation/base_animation.rb', line 16

def frames_per_second
  25.0
end