Class: UI::JKeyBinding

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

Overview

Class that allow to show a binding of a specific key on the Joypad

Constant Summary collapse

KeyIndex =

KeyIndex that holds the value of the key value in the order of the texture

[0, 1, 2, 3, 13, 15, 12, 14, 8, 9, 4, 5, 6, 7, 10, 11]

Instance Attribute Summary collapse

Attributes inherited from LiteRGSS::ShaderedSprite

#blendmode, #shader

Attributes inherited from LiteRGSS::Sprite

#__index__, #angle, #bitmap, #height, #mirror, #opacity, #ox, #oy, #src_rect, #viewport, #visible, #width, #x, #y, #z, #zoom, #zoom_x, #zoom_y

Instance Method Summary collapse

Methods inherited from Sprite

#load, #mouse_in?, #set_origin_div, #set_rect, #set_rect_div, #set_z, #simple_mouse_in?, #translate_mouse_coords

Methods inherited from LiteRGSS::Sprite

new, #set_origin, #set_position

Methods inherited from LiteRGSS::Disposable

#dispose, #disposed?

Constructor Details

#initialize(viewport, key) ⇒ JKeyBinding

Create a new KeyBinding sprite

Parameters:

  • viewport (Viewport)
  • key (Symbol)

    Input.trigger? argument



772
773
# File 'docs/01450_Systems_00000_General_00100_UI_Generics.rb', line 772

def initialize(viewport, key)
end

Instance Attribute Details

#keySymbol (readonly)

Returns the key the button describe.

Returns:

  • (Symbol)

    the key the button describe



768
769
770
# File 'docs/01450_Systems_00000_General_00100_UI_Generics.rb', line 768

def key
  @key
end

Instance Method Details

#find_key(key)

Find the key rect in the Sprite according to the input key requested

Parameters:

  • key (Symbol)

    the Virtual Input Key.



778
779
# File 'docs/01450_Systems_00000_General_00100_UI_Generics.rb', line 778

def find_key(key)
end

#indexInteger

Return the index of the key in the Keys array

Returns:

  • (Integer)


785
786
# File 'docs/01450_Systems_00000_General_00100_UI_Generics.rb', line 785

def index
end

#update

Update the key



781
782
# File 'docs/01450_Systems_00000_General_00100_UI_Generics.rb', line 781

def update
end