Class: UI::Options::Button

Inherits:
SpriteStack show all
Defined in:
docs/4_Systems_105_Options.rb

Overview

Button UI element

Constant Summary collapse

OPTION_OFFSET_Y =

Offset Y of each options

40
OPTION_BASE_X =

Base X of each options

19
OPTION_OFFSET_X =

Offset X of each options

4

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, #update_animation, #update_position, #visible, #visible=, #with_cache, #with_font, #with_surface, #z, #z=

Constructor Details

#initialize(viewport, index, option) ⇒ Button

Create a new Option Button

Parameters:



125
126
# File 'docs/4_Systems_105_Options.rb', line 125

def initialize(viewport, index, option)
end

Instance Attribute Details

#optionGamePlay::Options::Helper (readonly)

Option modified by the button



117
118
119
# File 'docs/4_Systems_105_Options.rb', line 117

def option
  @option
end

#valueOption

Current value shown by the button

Returns:

  • (Option)


120
121
122
# File 'docs/4_Systems_105_Options.rb', line 120

def value
  @value
end

Instance Method Details

#reload_texts

Reload the name of the button for when the language is changed in the options



140
141
# File 'docs/4_Systems_105_Options.rb', line 140

def reload_texts
end

#value_indexInteger

Return the value index

Returns:

  • (Integer)


129
130
# File 'docs/4_Systems_105_Options.rb', line 129

def value_index
end

#value_textString

Retreive the option value text

Returns:



137
138
# File 'docs/4_Systems_105_Options.rb', line 137

def value_text
end