Skip to content

Commit 65bc0ed

Browse files
committed
mouse_event
1 parent 27d2913 commit 65bc0ed

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class MouseThing < LibraryProxy
2+
def draw
3+
end
4+
5+
def mouseEvent(event)
6+
case event.action
7+
when MouseEvent::CLICK
8+
puts 'CLICK'
9+
when MouseEvent::DRAG
10+
puts 'DRAG'
11+
end
12+
end
13+
end
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env jruby
2+
require 'propane'
3+
4+
class MouseEventDemo < Propane::App
5+
load_libraries :library_proxy, :mouse_thing
6+
7+
def settings
8+
size(800, 600)
9+
end
10+
11+
def setup
12+
sketch_title 'Mouse Event Demo'
13+
MouseThing.new(self)
14+
end
15+
16+
def draw
17+
background(255)
18+
end
19+
end
20+
21+
MouseEventDemo.new

0 commit comments

Comments
 (0)