Class Rubygame::Events::MouseMoved
In: lib/rubygame/events/mouse_events.rb
Parent: Object

MouseMoved is an event class which occurs when the mouse cursor moves. It has attribute readers for pos (new position), rel (change since the last MouseMoved event), and buttons (an Array of the mouse buttons that were held down while moving).

Methods

new  

Attributes

buttons  [R] 
pos  [R] 
rel  [R] 

Public Class methods

Create a new MouseReleased instance.

pos:an Array for the new position of the mouse cursor. The point [0,0] is the top-left corner of the window (or the screen if running full-screen). (Array, required)
rel:an Array for the position change since the last MouseMoved event, in pixels. (Array, required)
buttons:an Array of symbols for the mouse buttons that were being held down while the mouse was moving. [] if no buttons were being held. (Array, optional)

[Source]

# File lib/rubygame/events/mouse_events.rb, line 140
      def initialize( pos, rel, buttons=[] )

        @pos = pos.to_ary.dup
        @pos.freeze

        @rel = rel.to_ary.dup
        @rel.freeze

        @buttons = buttons.to_ary.dup
        @buttons.freeze

      end

[Validate]