Class: RubySketch::VirtualKey::View
- Inherits:
-
Reflex::View
- Object
- Reflex::View
- RubySketch::VirtualKey::View
- Defined in:
- lib/rubysketch/window.rb
Instance Method Summary collapse
Instance Method Details
#on_draw(e) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/rubysketch/window.rb', line 17 def on_draw(e) e.painter.push do |pa| pa.fill 1, 0.1 draw_stick pa pa end end |
#on_pointer(e) ⇒ Object
25 26 27 28 29 |
# File 'lib/rubysketch/window.rb', line 25 def on_pointer(e) chars, key = get_chars_and_key e.pos @dispatcher.key_down chars, key if key && e.down? @dispatcher.key_up chars, key if !key || e.up? end |
#on_resize(e) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/rubysketch/window.rb', line 8 def on_resize(e) @dispatcher = VirtualKey::Dispatcher.new self @key_margin = @key_size = @stick_frame = @buttons_frame = nil super end |