Class: UI::KeyBindingViewer

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

Overview

Class that allow to see the KeyBinding for the PSDK virtual key

This object has two indexes :

- main_index : It's the index of the PSDK Key we want to see
- key_index : It's the index of the Binding we want to change
    if key_index is negative, it's not showing the index sprite

This object has a blink state linked to #update_blink allowing to tell the key is currently being edited

Constant Summary collapse

FT_X =

X position of the first text

12
ST_X =

X position of the second text

72
LT_X =

X position of the last text & the first button

208
FKT_Y =

Y position of the first key text

26
KEYS =

List of the Key to create with their information (PSDK name, Descr)

[[:A, 4, 13], [:B, 5, 14], [:X, 6, 15], [:Y, 7, 16], [:UP, 8, 17], [:DOWN, 9, 18], [:RIGHT, 10, 19], [:LEFT, 11, 20]]

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) ⇒ KeyBindingViewer

Create a new KeyBindingViewer



168
169
# File 'docs/01450_Systems_00105_Options.rb', line 168

def initialize(viewport)
end

Instance Attribute Details

#blinkingBoolean

Returns if the UI is in blinking mode.

Returns:

  • (Boolean)

    if the UI is in blinking mode



162
163
164
# File 'docs/01450_Systems_00105_Options.rb', line 162

def blinking
  @blinking
end

#key_indexInteger

Returns the key index.

Returns:

  • (Integer)

    the key index



166
167
168
# File 'docs/01450_Systems_00105_Options.rb', line 166

def key_index
  @key_index
end

#main_indexInteger

Returns the main index.

Returns:

  • (Integer)

    the main index



164
165
166
# File 'docs/01450_Systems_00105_Options.rb', line 164

def main_index
  @main_index
end

Instance Method Details

#current_keySymbol

Get the current key (to update the Input::Keys)

Returns:

  • (Symbol)


192
193
# File 'docs/01450_Systems_00105_Options.rb', line 192

def current_key
end

#current_key_index

Get the current key index according to the button



195
196
# File 'docs/01450_Systems_00105_Options.rb', line 195

def current_key_index
end

#update

Update all the buttons



176
177
# File 'docs/01450_Systems_00105_Options.rb', line 176

def update
end

Update the blink animation



173
174
# File 'docs/01450_Systems_00105_Options.rb', line 173

def update_blink
end