Class: UI::InputNumber

Inherits:
SpriteStack show all
Defined in:
scripts/01300 UI/09001 NameInput/00100 NumberInput.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

SpriteStack::NO_INITIAL_IMAGE

Instance Attribute Summary collapse

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, max_digits, default_number = 0, accept_negatives = false) ⇒ InputNumber

Create a new Input number

Parameters:

  • viewport (Viewport)
  • max_digits (Integer)

    maximum number of digit

  • default_number (Integer) (defaults to: 0)

    default number

  • accept_negatives (Boolean) (defaults to: false)

    if we can provide negative values

Instance Attribute Details

#maxInteger

Maximum value

Returns:

#minInteger

Minimum value

Returns:

#numberInteger

Currently inputed number

Returns:

Instance Method Details

#heightInteger

Get the height of the UI

Returns:

#update

Update the UI element

#widthInteger

Get the width of the UI

Returns: