| Class | Rubygame::EventTriggers::MouseMoveTrigger |
| In: |
lib/rubygame/event_triggers.rb
|
| Parent: | Object |
MouseMoveTrigger is an event trigger which fires when the mouse cursor is moved (MouseMoved). If buttons are given, it only matches events with those buttons. See new for details.
Create a new instance of MouseMoveTrigger.
The buttons parameter determines which mouse buttons can be held down and still match this trigger. It can be one of:
Example:
# Matches all MouseMoved events, regardless of buttons:
MouseMoveTrigger.new()
MouseMoveTrigger.new( :any )
# Matches only if no buttons pressed:
MouseMoveTrigger.new( :none )
MouseMoveTrigger.new( [] )
# Matches if left mouse is held down, maybe with others:
MouseMoveTrigger.new( :mouse_left )
# Matches if ONLY left mouse held down, nothing else:
MouseMoveTrigger.new( [:mouse_left] )
# Matches if BOTH left AND right mouse are held down, nothing else:
MouseMoveTrigger.new( [:mouse_left, :mouse_right] )
# Matches if EITHER left OR right mouse are held down:
OrTrigger.new( MouseMoveTrigger.new(:mouse_left),
MouseMoveTrigger.new(:mouse_right) )
Returns true if the given event matches this trigger. See new for information about how events match.