Class: Chronus::Mouse

Inherits:
Object
  • Object
show all
Includes:
SDL::Mouse
Defined in:
lib/chronus/mouse.rb

Class Method Summary collapse

Class Method Details

.button_pressed?(button) ⇒ Boolean

Returns:

  • (Boolean)


28
29
30
31
32
33
34
35
36
37
38
# File 'lib/chronus/mouse.rb', line 28

def self.button_pressed?(button)
  case button
  when BUTTON_LEFT
    return state[2]
  when BUTTON_MIDDLE
    return state[3]
  when BUTTON_RIGHT
    return state[4]
  end
  false
end

.hideObject



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

.showObject



12
13
14
# File 'lib/chronus/mouse.rb', line 12

def self.show
  SDL::Mouse.show
end

.show?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/chronus/mouse.rb', line 20

def self.show?
  SDL::Mouse.show?
end

.stateObject



8
9
10
# File 'lib/chronus/mouse.rb', line 8

def self.state
  SDL::Mouse.state
end