class

Opal::Input::Gamepad::VirtualCursor

Inherits Reference < Object

Analog virtual cursor that allows gamepad thumbsticks to navigate and click anywhere across the terminal grid like a mouse cursor.

Constructors

new(x : Float64 = 40.0, y : Float64 = 12.0)
Source

Instance methods

cell_x
Source
cell_y
Source
cursor_color
Source
cursor_color=(cursor_color : Color)
Source
cursor_glyph
Source
cursor_glyph=(cursor_glyph : Char)
Source
render(buffer : UI::Buffer) : Nil

Renders the virtual cursor glyph over the buffer

Source
speed
Source
speed=(speed : Float64)
Source
update(stick_x : Float64, stick_y : Float64, max_w : Int32, max_h : Int32, dt : Float64 = 0.0166) : Nil

Updates virtual cursor coordinates based on stick deflection (-1.0 to 1.0)

Source
visible=(visible : Bool)
Source
visible?
Source