Class: UI::TextScroller

Inherits:
SpriteStack show all
Defined in:
docs/4_Systems_000_General_4_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



936
937
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 936

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

Instance Method Details

#done?Boolean

Tell if the scrolling is done

Returns:

  • (Boolean)


947
948
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 947

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



940
941
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 940

def start(until_all_text_hidden: true)
end

#update

Update the scrolling



943
944
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 943

def update
end