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, #font_id, #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:



132
133
# File 'docs/4_Systems_105_Options.rb', line 132

def initialize(viewport, index, option)
end

Instance Attribute Details

#option ⇒ GamePlay::Options::Helper (readonly)

Option modified by the button



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

def option
  @option
end

#value ⇒ Option

Current value shown by the button

Returns:

  • (Option)


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

def value
  @value
end

Instance Method Details

#reload_texts

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



147
148
# File 'docs/4_Systems_105_Options.rb', line 147

def reload_texts
end

#value_index ⇒ Integer

Return the value index

Returns:

  • (Integer)


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

def value_index
end

#value_text ⇒ String

Retreive the option value text

Returns:



144
145
# File 'docs/4_Systems_105_Options.rb', line 144

def value_text
end