Class: UI::GenericBase
- Inherits:
-
SpriteStack
- Object
- SpriteStack
- UI::GenericBase
- Defined in:
- docs/4_Systems_000_General_4_UI_Generics.rb
Overview
Generica base UI for most of the scenes
Direct Known Subclasses
Defined Under Namespace
Classes: ControlButton
Constant Summary collapse
- DEFAULT_KEYS =
List of key by default
%i[A X Y B]
- BUTTON_TO_HIDE =
List of button to hide when a text is shown
0..2
Constants inherited from SpriteStack
Instance Attribute Summary collapse
- #background ⇒ Sprite readonly
-
#button_texts ⇒ Array<String>
The texts shown in the button.
-
#ctrl ⇒ Array<ControlButton>
readonly
The control buttons.
-
#keys ⇒ Array<Symbol>
Keys shown in the button.
Attributes inherited from SpriteStack
#animated, #data, #moving, #stack, #viewport, #x, #y
Instance Method Summary collapse
-
#hide_win_text
Hide the “win text”.
-
#initialize(viewport, texts = [], keys = DEFAULT_KEYS, hide_background_and_button: false) ⇒ GenericBase
constructor
Create a new GenericBase UI.
-
#show_win_text(text)
Show the “win text” (bottom text giving information to the player).
-
#update_background_animation
Update the background animation.
-
#win_text_visible? ⇒ Boolean
Tell if the win text is visible.
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, #update_animation, #update_position, #visible, #visible=, #with_cache, #with_font, #with_surface, #z, #z=
Constructor Details
#initialize(viewport, texts = [], keys = DEFAULT_KEYS, hide_background_and_button: false) ⇒ GenericBase
Create a new GenericBase UI
441 442 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 441 def initialize(, texts = [], keys = DEFAULT_KEYS, hide_background_and_button: false) end |
Instance Attribute Details
#background ⇒ Sprite (readonly)
431 432 433 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 431 def background @background end |
#button_texts ⇒ Array<String>
Returns the texts shown in the button.
427 428 429 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 427 def @button_texts end |
#ctrl ⇒ Array<ControlButton> (readonly)
Returns the control buttons.
429 430 431 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 429 def ctrl @ctrl end |
#keys ⇒ Array<Symbol>
Returns keys shown in the button.
425 426 427 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 425 def keys @keys end |
Instance Method Details
#hide_win_text
Hide the “win text”
456 457 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 456 def hide_win_text end |
#show_win_text(text)
Show the “win text” (bottom text giving information to the player)
453 454 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 453 def show_win_text(text) end |
#update_background_animation
Update the background animation
463 464 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 463 def update_background_animation end |
#win_text_visible? ⇒ Boolean
Tell if the win text is visible
460 461 |
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 460 def win_text_visible? end |