Class: Asciimation::DropAnimator
- Inherits:
-
Object
- Object
- Asciimation::DropAnimator
- Defined in:
- lib/asciimation/drop_animator.rb
Instance Method Summary collapse
- #animate(screen) ⇒ Object
-
#initialize(io:, options:) ⇒ DropAnimator
constructor
A new instance of DropAnimator.
Constructor Details
#initialize(io:, options:) ⇒ DropAnimator
Returns a new instance of DropAnimator.
3 4 5 6 |
# File 'lib/asciimation/drop_animator.rb', line 3 def initialize(io: , options: ) @io = io @options = end |
Instance Method Details
#animate(screen) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/asciimation/drop_animator.rb', line 11 def animate(screen) lines.each_with_index.reverse_each do |line, i| (i + 1 + top_lines(screen)).times do |y| draw_line(screen, " " * line.size, y - 1) unless y.zero? draw_line(screen, line, y) redraw(screen) wait(screen) end end end |