Class: UI::InputNumber
- Inherits:
-
SpriteStack
- Object
- SpriteStack
- UI::InputNumber
- Defined in:
- docs/4_Systems_205_Input.rb
Overview
UI element showing input number (for number choice & selling)
Constant Summary collapse
- IMAGE_SOURCE =
Image used as source for the UI build
'numin_bg'
- IMAGE_COMPOSITION =
List of coordinates used to know how to build the UI from the image
{left: [0, 0, 33, 44], number: [33, 0, 24, 44], separator: [57, 0, 6, 44], right: [83, 0, 10, 44], money_add: [94, 0, 68, 44]}
- MONEY_PADDING =
Padding for money text
2
Constants inherited from SpriteStack
Instance Attribute Summary collapse
-
#max ⇒ Integer
Maximum value.
-
#min ⇒ Integer
Minimum value.
-
#number ⇒ Integer
Currently inputed number.
Attributes inherited from SpriteStack
#animated, #data, #moving, #stack, #viewport, #x, #y
Instance Method Summary collapse
-
#height ⇒ Integer
Get the height of the UI.
-
#initialize(viewport, max_digits, default_number = 0, accept_negatives = false) ⇒ InputNumber
constructor
Create a new Input number.
-
#update
Update the UI element.
-
#width ⇒ Integer
Get the width of the UI.
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, max_digits, default_number = 0, accept_negatives = false) ⇒ InputNumber
Create a new Input number
97 98 |
# File 'docs/4_Systems_205_Input.rb', line 97 def initialize(, max_digits, default_number = 0, accept_negatives = false) end |
Instance Attribute Details
#max ⇒ Integer
Maximum value
88 89 90 |
# File 'docs/4_Systems_205_Input.rb', line 88 def max @max end |
#min ⇒ Integer
Minimum value
85 86 87 |
# File 'docs/4_Systems_205_Input.rb', line 85 def min @min end |
#number ⇒ Integer
Currently inputed number
91 92 93 |
# File 'docs/4_Systems_205_Input.rb', line 91 def number @number end |
Instance Method Details
#height ⇒ Integer
Get the height of the UI
112 113 |
# File 'docs/4_Systems_205_Input.rb', line 112 def height end |
#update
Update the UI element
100 101 |
# File 'docs/4_Systems_205_Input.rb', line 100 def update end |
#width ⇒ Integer
Get the width of the UI
108 109 |
# File 'docs/4_Systems_205_Input.rb', line 108 def width end |