Class: Stagecraft::Window::Adapter
- Inherits:
-
Object
- Object
- Stagecraft::Window::Adapter
- Defined in:
- lib/stagecraft/window/adapter.rb
Instance Method Summary collapse
-
#initialize ⇒ Adapter
constructor
A new instance of Adapter.
- #on_pointer_button(&block) ⇒ Object
- #on_pointer_move(&block) ⇒ Object
- #on_resize(&block) ⇒ Object
- #on_scroll(&block) ⇒ Object
Constructor Details
#initialize ⇒ Adapter
Returns a new instance of Adapter.
6 7 8 |
# File 'lib/stagecraft/window/adapter.rb', line 6 def initialize @callbacks = Hash.new { |hash, key| hash[key] = [] } end |
Instance Method Details
#on_pointer_button(&block) ⇒ Object
10 11 12 |
# File 'lib/stagecraft/window/adapter.rb', line 10 def (&block) subscribe(:pointer_button, &block) end |
#on_pointer_move(&block) ⇒ Object
14 15 16 |
# File 'lib/stagecraft/window/adapter.rb', line 14 def on_pointer_move(&block) subscribe(:pointer_move, &block) end |
#on_resize(&block) ⇒ Object
22 23 24 |
# File 'lib/stagecraft/window/adapter.rb', line 22 def on_resize(&block) subscribe(:resize, &block) end |
#on_scroll(&block) ⇒ Object
18 19 20 |
# File 'lib/stagecraft/window/adapter.rb', line 18 def on_scroll(&block) subscribe(:scroll, &block) end |