Class: Rubygame::JoyDownEvent

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

Overview

Indicates that a Joystick button was pressed.

This event has these attributes:

joynum

the identifier number of the affected Joystick.

hat

the identifier number of the button.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(joy, button) ⇒ JoyDownEvent

Returns a new instance of JoyDownEvent.



377
378
379
380
381
382
# File 'lib/rubygame/event.rb', line 377

def initialize(joy,button)
  # eventually, joy could be int OR a Rubygame::Joystick instance,
  # which would be stored as joy or maybe joyinstance?
  @joynum = joy
  @button = button
end

Instance Attribute Details

#buttonObject

Returns the value of attribute button.



376
377
378
# File 'lib/rubygame/event.rb', line 376

def button
  @button
end

#joynumObject

Returns the value of attribute joynum.



376
377
378
# File 'lib/rubygame/event.rb', line 376

def joynum
  @joynum
end