Class: UI::KeyBinding

Inherits:
KeyShortcut show all
Defined in:
docs/4_Systems_000_General_4_UI_Generics.rb

Overview

Class that allow to show a binding of a specific key

Constant Summary

Constants inherited from KeyShortcut

UI::KeyShortcut::KeyIndex, UI::KeyShortcut::NUMPAD_KEY_INDEX

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 KeyShortcut

#show_key

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

#set_origin, #set_position

Methods inherited from LiteRGSS::Disposable

#dispose, #disposed?

Constructor Details

#initialize(viewport, key, index) ⇒ KeyBinding

Create a new KeyBinding sprite

Parameters:

  • viewport (Viewport)
  • key (Symbol) —

    Input.trigger? argument

  • index (Integer) —

    Index of the key in the Keys constant



907
908
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 907

def initialize(viewport, key, index)
end

Instance Attribute Details

#index ⇒ Integer (readonly)

Returns the index of the key in the Keys array.

Returns:

  • (Integer) —

    the index of the key in the Keys array



902
903
904
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 902

def index
  @index
end

#key ⇒ Symbol (readonly)

Returns the key the button describe.

Returns:

  • (Symbol) —

    the key the button describe



900
901
902
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 900

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.



911
912
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 911

def find_key(key)
end

#update

Update the key



914
915
# File 'docs/4_Systems_000_General_4_UI_Generics.rb', line 914

def update
end