Class: Chronus::Mouse
- Inherits:
-
Object
- Object
- Chronus::Mouse
- Includes:
- SDL::Mouse
- Defined in:
- lib/chronus/mouse.rb
Class Method Summary collapse
- .button_pressed?(button) ⇒ Boolean
- .hide ⇒ Object
- .pos(x, y) ⇒ Object
- .show ⇒ Object
- .show? ⇒ Boolean
- .state ⇒ Object
Class Method Details
.button_pressed?(button) ⇒ Boolean
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/chronus/mouse.rb', line 28 def self.() case when BUTTON_LEFT return state[2] when BUTTON_MIDDLE return state[3] when BUTTON_RIGHT return state[4] end false end |
.hide ⇒ Object
16 17 18 |
# File 'lib/chronus/mouse.rb', line 16 def self.hide SDL::Mouse.hide end |
.pos(x, y) ⇒ Object
24 25 26 |
# File 'lib/chronus/mouse.rb', line 24 def self.pos(x,y) SDL::Mouse.warp(x,y) end |
.show ⇒ Object
12 13 14 |
# File 'lib/chronus/mouse.rb', line 12 def self.show SDL::Mouse.show end |
.show? ⇒ Boolean
20 21 22 |
# File 'lib/chronus/mouse.rb', line 20 def self.show? SDL::Mouse.show? end |
.state ⇒ Object
8 9 10 |
# File 'lib/chronus/mouse.rb', line 8 def self.state SDL::Mouse.state end |