Skip to content

Commit adfcb83

Browse files
committed
mouse_event
1 parent b08fc6e commit adfcb83

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-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: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
load_libraries :library_proxy, :mouse_thing
2+
3+
attr_reader :mouseThing
4+
5+
def settings
6+
size(800, 600)
7+
end
8+
9+
def setup
10+
sketch_title 'Mouse Event'
11+
frameRate(1)
12+
MouseThing.new(self)
13+
end
14+
15+
def draw
16+
background(255)
17+
end

0 commit comments

Comments
 (0)