Class: Rubygame::JoyAxisEvent
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
-
#axis ⇒ Object
Returns the value of attribute axis.
-
#joynum ⇒ Object
Returns the value of attribute joynum.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(joy, axis, value) ⇒ JoyAxisEvent
constructor
A new instance of JoyAxisEvent.
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
#axis ⇒ Object
Returns the value of attribute axis.
319 320 321 |
# File 'lib/rubygame/event.rb', line 319 def axis @axis end |
#joynum ⇒ Object
Returns the value of attribute joynum.
319 320 321 |
# File 'lib/rubygame/event.rb', line 319 def joynum @joynum end |
#value ⇒ Object
Returns the value of attribute value.
319 320 321 |
# File 'lib/rubygame/event.rb', line 319 def value @value end |