Class: RbSDL2::Mouse::RelativeMouse

Inherits:
MouseClass show all
Includes:
Singleton
Defined in:
lib/rb_sdl2/mouse/relative_mouse.rb

Constant Summary

Constants included from MouseButton

MouseButton::BUTTON, MouseButton::BUTTON_LMASK, MouseButton::BUTTON_MMASK, MouseButton::BUTTON_RMASK, MouseButton::BUTTON_X1MASK, MouseButton::BUTTON_X2MASK

Instance Attribute Summary

Attributes inherited from MouseClass

#button, #x, #y

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from MouseClass

#initialize, #position, #position=

Methods included from MouseButton

#any_button?, #button?, #left_button?, #middle_button?, #right_button?, #x1_button?, #x2_button?

Constructor Details

This class inherits a constructor from RbSDL2::Mouse::MouseClass

Class Method Details

.updateObject



13
14
15
16
17
# File 'lib/rb_sdl2/mouse/relative_mouse.rb', line 13

def update
  self.button, self.x, self.y =
    ::SDL.GetRelativeMouseState(@_x, @_y), @_x.read_int, @_y.read_int
  self
end

Instance Method Details

#updateObject



20
21
22
23
# File 'lib/rb_sdl2/mouse/relative_mouse.rb', line 20

def update
  self.class.update
  self
end