Class: Rubygame::JoyAxisEvent

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

Overview

Indicates that a Joystick axis was moved.

This event has these attributes:

joynum

the identifier number of the affected Joystick.

axis

the identifier number of the axis.

value

the new value of the axis, between -32768 and 32767

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(joy, axis, value) ⇒ JoyAxisEvent

Returns a new instance of JoyAxisEvent.



320
321
322
323
324
325
# File 'lib/rubygame/event.rb', line 320

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

Instance Attribute Details

#axisObject

Returns the value of attribute axis.



319
320
321
# File 'lib/rubygame/event.rb', line 319

def axis
  @axis
end

#joynumObject

Returns the value of attribute joynum.



319
320
321
# File 'lib/rubygame/event.rb', line 319

def joynum
  @joynum
end

#valueObject

Returns the value of attribute value.



319
320
321
# File 'lib/rubygame/event.rb', line 319

def value
  @value
end