Class: Rubygame::MouseMotionEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/rubygame/event.rb

Overview

Indicates that the mouse cursor moved.

This event has these attributes:

pos

the new position of the cursor, in the form [x,y].

rel

the relative movement of the cursor since the last update, [x,y].

buttons

the mouse buttons that were being held during the movement, an Array of zero or more of these constants in module Rubygame (or the corresponding button number):

MOUSE_LEFT

1; left mouse button

MOUSE_MIDDLE

2; middle mouse button

MOUSE_RIGHT

3; right mouse button

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pos, rel, buttons) ⇒ MouseMotionEvent

Returns a new instance of MouseMotionEvent.



256
257
258
# File 'lib/rubygame/event.rb', line 256

def initialize(pos,rel,buttons)
	@pos, @rel, @buttons = pos, rel, buttons
end

Instance Attribute Details

#buttonsObject

Returns the value of attribute buttons.



255
256
257
# File 'lib/rubygame/event.rb', line 255

def buttons
  @buttons
end

#posObject

Returns the value of attribute pos.



255
256
257
# File 'lib/rubygame/event.rb', line 255

def pos
  @pos
end

#relObject

Returns the value of attribute rel.



255
256
257
# File 'lib/rubygame/event.rb', line 255

def rel
  @rel
end