class Opal::Input::Gamepad::VirtualCursor

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.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(x : Float64 = 40.0, y : Float64 = 12.0) #

[View source]

Instance Method Detail

def cell_x : Int32 #

[View source]
def cell_y : Int32 #

[View source]
def cursor_color : Color #

[View source]
def cursor_color=(cursor_color : Color) #

[View source]
def cursor_glyph : Char #

[View source]
def cursor_glyph=(cursor_glyph : Char) #

[View source]
def render(buffer : UI::Buffer) : Nil #

Renders the virtual cursor glyph over the buffer


[View source]
def speed : Float64 #

[View source]
def speed=(speed : Float64) #

[View source]
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)


[View source]
def visible=(visible : Bool) #

[View source]
def visible? : Bool #

[View source]
def x : Float64 #

[View source]
def x=(x : Float64) #

[View source]
def y : Float64 #

[View source]
def y=(y : Float64) #

[View source]