Class: UI::GenericBase::ControlButton

Inherits:
SpriteStack show all
Defined in:
docs/01450_Systems_00000_General_00100_UI_Generics.rb

Overview

Generic Button used to help the player to know what key he can press

Constant Summary collapse

COORDINATES =

Array of button coordinates

[[3, 219], [83, 219], [163, 219], [243, 219]]

Constants inherited from SpriteStack

SpriteStack::NO_INITIAL_IMAGE

Instance Attribute Summary

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, coords_index, key) ⇒ ControlButton

Create a new Button

Parameters:

  • viewport (Viewport)
  • coords_index (Integer)

    index of the coordinates to use in order to position the button

  • key (Symbol)

    key to show by default



449
450
# File 'docs/01450_Systems_00000_General_00100_UI_Generics.rb', line 449

def initialize(viewport, coords_index, key)
end

Instance Method Details

#key=(value)

Set the key shown by the button

Parameters:

  • value (Symbol)


462
463
# File 'docs/01450_Systems_00000_General_00100_UI_Generics.rb', line 462

def key=(value)
end

#pressed=(pressed) Also known as: set_press

Set the button pressed

Parameters:

  • pressed (Boolean)

    if the button is pressed or not



453
454
# File 'docs/01450_Systems_00000_General_00100_UI_Generics.rb', line 453

def pressed=(pressed)
end

#text=(value)

Set the text shown by the button

Parameters:

  • value (String)

    text to show



458
459
# File 'docs/01450_Systems_00000_General_00100_UI_Generics.rb', line 458

def text=(value)
end