Class: WSLight::Animation::SlideLeftAnimation
Overview
Slides from one set to another from left to right (obviously depending on the hardware setup)
Instance Attribute Summary
#set_from, #set_to, #type
Instance Method Summary
collapse
#frame_data, #initialize
Instance Method Details
#frame(count) ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/ws_light/animation/slide_left_animation.rb', line 11
def frame(count)
set = []
reverse_set = []
@set_from.next_frame
@set_to.next_frame
(set_from.length - count).times do |i|
set << set_from.pixel(i)
reverse_set << set_from.pixel((set_from.length * 2) - 1 - i) if set_from.type == :double
end
count.times do |i|
set << set_to.pixel(set_from.length - count + i)
reverse_set << set_to.pixel(set_from.length + count - 1 - i) if set_from.type == :double
end
set += reverse_set.reverse if set_from.type == :double
set
end
|
#frames ⇒ Object
7
8
9
|
# File 'lib/ws_light/animation/slide_left_animation.rb', line 7
def frames
@set_from.length + 1 end
|
#frames_per_second ⇒ Object
33
34
35
|
# File 'lib/ws_light/animation/slide_left_animation.rb', line 33
def frames_per_second
nil
end
|