class
Opal::Input::Gamepad::VirtualCursor
- Opal::Input::Gamepad::VirtualCursor
- Reference
- Object
Overview
Analog virtual cursor that allows gamepad thumbsticks to navigate and click anywhere across the terminal grid like a mouse cursor.
Defined in:
opal/gamepad/virtual_cursor.crConstructors
Instance Method Summary
- #cell_x : Int32
- #cell_y : Int32
- #cursor_color : Color
- #cursor_color=(cursor_color : Color)
- #cursor_glyph : Char
- #cursor_glyph=(cursor_glyph : Char)
-
#render(buffer : UI::Buffer) : Nil
Renders the virtual cursor glyph over the buffer
- #speed : Float64
- #speed=(speed : Float64)
-
#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)
- #visible=(visible : Bool)
- #visible? : Bool
- #x : Float64
- #x=(x : Float64)
- #y : Float64
- #y=(y : Float64)
Constructor Detail
Instance Method Detail
def 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)