Class: UI::GenericBase::ControlButton

Inherits:
SpriteStack show all
Defined in:
docs/4_Systems_000_General_4_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



501
502
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 501

def initialize(viewport, coords_index, key)
end

Instance Method Details

#key=(value)

Set the key shown by the button

Parameters:

  • value (Symbol)


514
515
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 514

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



505
506
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 505

def pressed=(pressed)
end

#text=(value)

Set the text shown by the button

Parameters:

  • value (String)

    text to show



510
511
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 510

def text=(value)
end