Class: WSLight::Animation::SlideRightAnimation
Overview
Slides from one set to another from right to left (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
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/ws_light/animation/slide_right_animation.rb', line 12
def frame(count)
set = []
reverse_set = []
@set_from.next_frame
@set_to.next_frame
count.times do |i|
set << set_to.pixel(i)
reverse_set << set_to.pixel((set_from.length * 2) - 1 - i)
end
(set_from.length - count).times do |i|
set << set_from.pixel(i + count)
reverse_set << set_from.pixel((set_from.length * 2) - count - 1 - i)
end
set += reverse_set.reverse if set_from.type == :double
set
end
|
#frames ⇒ Object
8
9
10
|
# File 'lib/ws_light/animation/slide_right_animation.rb', line 8
def frames
@set_from.length + 1 end
|
#frames_per_second ⇒ Object
34
35
36
|
# File 'lib/ws_light/animation/slide_right_animation.rb', line 34
def frames_per_second
nil
end
|