Class: Pixelflow::Canvas::Event
- Inherits:
-
Object
- Object
- Pixelflow::Canvas::Event
- Defined in:
- lib/pixelflow_canvas.rb
Overview
EVENT POLLING
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(data) ⇒ Event
constructor
A new instance of Event.
- #on(type, &block) ⇒ Object
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
#data ⇒ Object (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 |