Class: SDL2::Joystick::Balls
- Inherits:
-
Components
- Object
- Components
- SDL2::Joystick::Balls
- Defined in:
- lib/sdl2/joystick/balls.rb
Overview
Enumerates buttons on a joystick.
Instance Method Summary collapse
-
#[](idx) ⇒ Object
Button accessor via index.
-
#count ⇒ Object
How many buttons are there?.
Methods inherited from Components
Constructor Details
This class inherits a constructor from SDL2::Joystick::Components
Instance Method Details
#[](idx) ⇒ Object
Button accessor via index
17 18 19 20 21 |
# 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 ⇒ Object
How many buttons are there?
11 12 13 |
# File 'lib/sdl2/joystick/balls.rb', line 11 def count SDL2::joystick_num_balls(@joystick) end |