class SDL2::Joystick::Balls
Enumerates buttons on a joystick.
Public Instance Methods
[](idx)
click to toggle source
Button accessor via index @returns [DeltaX, DeltaY] integers
# File lib/sdl2/joystick/balls.rb, line 17 def [](idx) dx, dy = SDL2::TypedPointer::Int.new, SDL2::TypedPointer::Int.new SDL2::joystick_get_ball(@joystick,idx, dx, dy) [dx.value, dy.value] end
count()
click to toggle source
How many buttons are there?
# File lib/sdl2/joystick/balls.rb, line 11 def count SDL2::joystick_num_balls(@joystick) end