Class: UI::MouseSectionEvent
- Inherits:
-
Object
- Object
- UI::MouseSectionEvent
- Defined in:
- lib/ektoplayer/ui.rb
Instance Method Summary collapse
-
#initialize(start = nil, stop = nil) ⇒ MouseSectionEvent
constructor
A new instance of MouseSectionEvent.
- #on(button, &block) ⇒ Object
- #trigger(mevent) ⇒ Object
Constructor Details
#initialize(start = nil, stop = nil) ⇒ MouseSectionEvent
Returns a new instance of MouseSectionEvent.
278 279 280 |
# File 'lib/ektoplayer/ui.rb', line 278 def initialize(start=nil, stop=nil) @start_pos, @stop_pos, @events = start, stop, MouseEvents.new end |
Instance Method Details
#on(button, &block) ⇒ Object
282 |
# File 'lib/ektoplayer/ui.rb', line 282 def on(, &block); @events.on(, &block) end |
#trigger(mevent) ⇒ Object
284 285 286 287 |
# File 'lib/ektoplayer/ui.rb', line 284 def trigger(mevent) return unless mevent.pos >= @start_pos and mevent.pos <= @stop_pos @events.trigger(mevent) end |