Class: Rubygame::JoyBallEvent

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

Overview

Indicates that a Joystick trackball was moved.

This event has these attributes:

joynum

the identifier number of the affected Joystick.

ball

the identifier number of the trackball.

rel

the relative movement of the trackball, [x,y].

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(joy, ball, rel) ⇒ JoyBallEvent

Returns a new instance of JoyBallEvent.



336
337
338
339
340
341
# File 'lib/rubygame/event.rb', line 336

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

Instance Attribute Details

#ballObject

Returns the value of attribute ball.



335
336
337
# File 'lib/rubygame/event.rb', line 335

def ball
  @ball
end

#joynumObject

Returns the value of attribute joynum.



335
336
337
# File 'lib/rubygame/event.rb', line 335

def joynum
  @joynum
end

#relObject

Returns the value of attribute rel.



335
336
337
# File 'lib/rubygame/event.rb', line 335

def rel
  @rel
end