Class: UI::TextScroller

Inherits:
SpriteStack show all
Defined in:
docs/01450_Systems_00000_General_00100_UI_Generics.rb

Overview

Class describing a text scroller (used in Credits)

Constant Summary collapse

DOUBLE_COLUMN_SEP =

Separator for double column

' || '

Constants inherited from SpriteStack

SpriteStack::NO_INITIAL_IMAGE

Instance Attribute Summary

Attributes inherited from SpriteStack

#animated, #data, #moving, #stack, #viewport, #x, #y

Instance Method Summary collapse

Methods inherited from SpriteStack

#[], #add_background, #add_line, #add_text, #anime, #anime_delta_set, #dispose, #each, #execute_anime, #move, #move_to, #opacity, #opacity=, #push, #push_sprite, #set_origin, #set_position, #simple_mouse_in?, #size, #stop_animation, #translate_mouse_coords, #update_animation, #update_position, #visible, #visible=, #with_cache, #with_font, #with_surface, #z, #z=

Constructor Details

#initialize(viewport, texts, line_height, speed) ⇒ TextScroller

Create a new text scroller

Parameters:

  • viewport (Viewport)
  • texts (Array<String>)
  • line_height (Integer)

    height of a line of text

  • speed (Float)

    number of pixels / seconds



879
880
# File 'docs/01450_Systems_00000_General_00100_UI_Generics.rb', line 879

def initialize(viewport, texts, line_height, speed)
end

Instance Method Details

#done?Boolean

Tell if the scrolling is done

Returns:

  • (Boolean)


890
891
# File 'docs/01450_Systems_00000_General_00100_UI_Generics.rb', line 890

def done?
end

#start(until_all_text_hidden: true)

Start the text scroll

Parameters:

  • until_all_text_hidden (Boolean) (defaults to: true)

    if the animation should last until the last text is offscreen



883
884
# File 'docs/01450_Systems_00000_General_00100_UI_Generics.rb', line 883

def start(until_all_text_hidden: true)
end

#update

Update the scrolling



886
887
# File 'docs/01450_Systems_00000_General_00100_UI_Generics.rb', line 886

def update
end