Class: Pixelflow::Canvas::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/pixelflow_canvas.rb

Overview

EVENT POLLING

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Event

Returns a new instance of Event.



781
782
783
# File 'lib/pixelflow_canvas.rb', line 781

def initialize(data)
    @data = data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



785
786
787
# File 'lib/pixelflow_canvas.rb', line 785

def data
  @data
end

Instance Method Details

#on(type, &block) ⇒ Object



787
788
789
790
791
# File 'lib/pixelflow_canvas.rb', line 787

def on(type, &block)
    if type == :mouse_move && @data[0] == 3
        yield(@data[1], @data[2])
    end
end