Class: FunCi::Tui::AnimationRenderer
- Inherits:
-
Object
- Object
- FunCi::Tui::AnimationRenderer
- Defined in:
- lib/fun_ci/tui/animation_renderer.rb
Constant Summary collapse
- HEADER_HEIGHT =
HeaderAnimationManager::HEADER_HEIGHT
Instance Method Summary collapse
- #active_count ⇒ Object
- #any_active? ⇒ Boolean
-
#initialize(animation_library: AnimationLibrary) ⇒ AnimationRenderer
constructor
A new instance of AnimationRenderer.
- #render(screen, runs) ⇒ Object
Constructor Details
#initialize(animation_library: AnimationLibrary) ⇒ AnimationRenderer
Returns a new instance of AnimationRenderer.
14 15 16 17 18 |
# File 'lib/fun_ci/tui/animation_renderer.rb', line 14 def initialize(animation_library: AnimationLibrary) @previous_runs = [] @animations = [] @header_manager = HeaderAnimationManager.new(animation_library: animation_library) end |
Instance Method Details
#active_count ⇒ Object
37 38 39 |
# File 'lib/fun_ci/tui/animation_renderer.rb', line 37 def active_count @animations.count { |a| !a.finished? } end |
#any_active? ⇒ Boolean
33 34 35 |
# File 'lib/fun_ci/tui/animation_renderer.rb', line 33 def any_active? @animations.any? { |a| !a.finished? } || @header_manager.any_active_event? end |
#render(screen, runs) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/fun_ci/tui/animation_renderer.rb', line 20 def render(screen, runs) detect_and_queue(runs) screen.save_cursor (screen) (screen, runs) (screen, runs) screen.restore_cursor advance_all expire_finished end |