15.events.pd 1.64 KB
Newer Older
1
#N struct drawtut-events float x float y;
Jonathan Wilkes's avatar
Jonathan Wilkes committed
2
3
#N canvas 230 46 591 620 10;
#X scalar drawtut-events 54 255 \;;
4
5
#X text 1 1 __________________________________;
#X text 0 1 New Drawing Commands: mouse events;
Jonathan Wilkes's avatar
Jonathan Wilkes committed
6
7
8
#X obj 53 117 loadbang;
#X text 53 400 The following events are reported:;
#X symbolatom 53 227 10 0 0 1 event_type - -, f 10;
9
#X obj 53 87 struct drawtut-events float x float y;
Jonathan Wilkes's avatar
Jonathan Wilkes committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#X msg 341 164 fill white;
#X obj 303 117 loadbang;
#X obj 53 204 unpack s;
#X msg 53 140 fill blue;
#X msg 143 140 mouseover 1 \, mouseout 1;
#X obj 143 117 loadbang;
#X obj 303 206 unpack s;
#X symbolatom 303 227 10 0 0 1 event_type - -, f 10;
#X text 130 272 <- mouse over these shapes ->;
#X text 53 329 When you move to the center of the center \, you generate
a "mouseout" event. This is because the circle has no fill color. Once
you set a fill color-- even white-- then the middle will count as part
of the shape.;
#X text 53 465 mouseover - mouse enters a shape;
#X text 53 485 mouseout - mouse leaves a shape;
#X text 53 505 mousemove - mouse moves inside a shape;
#X text 53 425 mousedown - mouse button is pressed;
#X text 53 445 mouseup - mousebutton is released;
#X obj 53 173 draw rect 0 0 60 60;
#X obj 303 185 draw circle 300 30 25;
#X msg 303 140 stroke-width 20 \, stroke black \, fill none;
#X text 53 43 When the user mouses over or clicks a shape a message
gets sent to the outlet of the corresponding [draw] object.;
#X connect 3 0 10 0;
#X connect 7 0 23 0;
#X connect 8 0 24 0;
#X connect 9 0 5 0;
#X connect 10 0 22 0;
#X connect 11 0 22 0;
#X connect 11 0 23 0;
#X connect 12 0 11 0;
#X connect 13 0 14 0;
#X connect 22 0 9 0;
#X connect 23 0 13 0;
#X connect 24 0 23 0;