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.



815
816
817
# File 'lib/pixelflow_canvas.rb', line 815

def initialize(data)
    @data = data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



819
820
821
# File 'lib/pixelflow_canvas.rb', line 819

def data
  @data
end

Instance Method Details

#on(type, &block) ⇒ Object



821
822
823
824
825
# File 'lib/pixelflow_canvas.rb', line 821

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