Class: UI::MiningGame::Tool_Buttons
- Inherits:
-
SpriteStack
- Object
- SpriteStack
- UI::MiningGame::Tool_Buttons
- Defined in:
- docs/4_Systems_801_Mining_Game.rb
Overview
Class that describes the buttons that let the player choose his tool
Constant Summary collapse
- COORD_Y_2_TOOLS =
Coordinates in no dynamite mode
[0, 80]
- COORD_Y_3_TOOLS =
Coordinates in dynamite mode
[0, 64, 128]
- TOOL_FILENAME =
Symbols of the tools
['pickaxe', 'mace', 'dynamite']
Constants inherited from SpriteStack
Instance Attribute Summary collapse
-
#animation ⇒ Yuki::Animation::TimedAnimation
The animation played when selecting a button.
-
#buttons ⇒ Array<SpriteSheet>
The array containing each button.
-
#index ⇒ Integer
The currently selected button.
Attributes inherited from SpriteStack
#animated, #data, #moving, #stack, #viewport, #x, #y
Instance Method Summary collapse
-
#change_buttons_state(index) ⇒ Symbol
Change the state of each button depending on the one that is hit.
-
#cycle_through_buttons ⇒ Symbol
Cycle through the buttons with a keyboard input.
-
#initialize(viewport) ⇒ Tool_Buttons
constructor
Create the tool buttons.
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) ⇒ Tool_Buttons
Create the tool buttons
637 638 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 637 def initialize() end |
Instance Attribute Details
#animation ⇒ Yuki::Animation::TimedAnimation
Returns the animation played when selecting a button.
634 635 636 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 634 def animation @animation end |
#buttons ⇒ Array<SpriteSheet>
Returns the array containing each button.
632 633 634 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 632 def @buttons end |
#index ⇒ Integer
Returns the currently selected button.
630 631 632 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 630 def index @index end |
Instance Method Details
#change_buttons_state(index) ⇒ Symbol
Change the state of each button depending on the one that is hit
642 643 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 642 def (index) end |
#cycle_through_buttons ⇒ Symbol
Cycle through the buttons with a keyboard input
646 647 |
# File 'docs/4_Systems_801_Mining_Game.rb', line 646 def end |