Class: Rubygame::Events::MousePressed

Inherits:
Object
  • Object
show all
Includes:
MouseButtonEvent
Defined in:
lib/rubygame/events/mouse_events.rb

Overview

MousePressed is an event class which occurs when a button on the mouse is pressed down.

This class gains #button and #pos attribute readers from the MouseButtonEvent mixin module.

Instance Attribute Summary

Attributes included from MouseButtonEvent

#button, #pos

Instance Method Summary collapse

Constructor Details

#initialize(pos, button) ⇒ MousePressed

Create a new MousePressed instance.

button

a symbol for the button that was pressed or released. (Symbol, required)

pos

an Array for the position of the mouse cursor when the event occured. [0,0] is the top-left corner of the window (or the screen if running full-screen). (Array, required)



82
83
84
# File 'lib/rubygame/events/mouse_events.rb', line 82

def initialize( pos, button )
  super
end