Class: UI::GenericBaseMultiMode
- Inherits:
-
GenericBase
- Object
- SpriteStack
- GenericBase
- UI::GenericBaseMultiMode
- Defined in:
- scripts/01450 Systems/00000 General/00100 UI Generics/00400 GenericBase.rb
Overview
Generic base allowing multiple button mode by initilizing it with all the value for keys & texts
Constant Summary
Constants inherited from GenericBase
UI::GenericBase::BUTTON_TO_HIDE, UI::GenericBase::DEFAULT_KEYS
Constants inherited from SpriteStack
Instance Attribute Summary collapse
-
#mode ⇒ Integer
Current mode of the UI.
Attributes inherited from GenericBase
#background, #button_texts, #ctrl, #keys
Attributes inherited from SpriteStack
#animated, #data, #moving, #stack, #viewport, #x, #y
Instance Method Summary collapse
-
#initialize(viewport, texts, keys, mode = 0) ⇒ GenericBaseMultiMode
constructor
Create a new GenericBase UI.
Methods inherited from GenericBase
#hide_win_text, #show_win_text, #update_background_animation, #win_text_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, mode = 0) ⇒ GenericBaseMultiMode
Create a new GenericBase UI
194 195 196 197 198 199 200 |
# File 'scripts/01450 Systems/00000 General/00100 UI Generics/00400 GenericBase.rb', line 194 def initialize(, texts, keys, mode = 0) raise 'Text array & key array should have the same size' if texts.size != keys.size @texts_array = texts @keys_array = keys @mode = mode.clamp(0, keys.size) super(, texts[@mode], keys[@mode]) end |
Instance Attribute Details
#mode ⇒ Integer
Returns current mode of the UI.
189 190 191 |
# File 'scripts/01450 Systems/00000 General/00100 UI Generics/00400 GenericBase.rb', line 189 def mode @mode end |