gil_mouseover_circle.pd 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #N canvas 235 22 557 681 10;
  2. #X obj 100 358 -;
  3. #X obj 100 402 *;
  4. #X obj 100 380 t f f;
  5. #X obj 100 464 +;
  6. #X obj 157 358 -;
  7. #X obj 157 402 *;
  8. #X obj 157 380 t f f;
  9. #X obj 157 424 t b f;
  10. #X obj 100 538 change;
  11. #X text 216 203 object position x \, y;
  12. #X obj 100 486 sqrt;
  13. #X obj 73 207 t l l;
  14. #X obj 344 310 loadbang;
  15. #X obj 344 356 sel 0;
  16. #X obj 100 516 <= 1;
  17. #X obj 73 626 outlet cursor-list;
  18. #X obj 73 176 inlet cursor-list;
  19. #X obj 223 226 inlet x;
  20. #X obj 283 226 inlet y;
  21. #X obj 383 226 inlet r;
  22. #X text 68 23 gil_mouseover_circle <radius>;
  23. #X text 101 589 outlet 2: 1 if cursor inside r \, 0 if cursor outside
  24. r;
  25. #X text 285 458 (c)2011 Marian Weger /part of GIL/;
  26. #X text 381 207 inlet 3: radius;
  27. #X obj 100 570 outlet mouseover;
  28. #X obj 344 332 \$1;
  29. #X obj 100 229 unpack f f f;
  30. #X obj 169 250 * -1;
  31. #X obj 169 272 + 1;
  32. #X obj 100 311 spigot 1;
  33. #X obj 157 311 spigot 1;
  34. #X text 65 54 [gil_mouseover_circle] detects \, if the cursor hovers
  35. over a given point inside the gemwin \, in a given radius around that
  36. point. When the cursor enters the radius \, and the left button is
  37. not pressed since the cursor has been outside the circle \, a '1' is
  38. sent to the 2nd outlet. By leaving the radius \, having the left mouse
  39. button unpressed \, the 2nd outlet gets a '0'. the radius can be given
  40. by either creation argument or 3rd inlet.;
  41. #X obj 253 503 cnv 15 220 50 empty empty HELP? 20 12 0 14 -261234 -258113
  42. 0;
  43. #X text 254 530 for further help: see [gil_example];
  44. #X connect 0 0 2 0;
  45. #X connect 1 0 3 0;
  46. #X connect 2 0 1 0;
  47. #X connect 2 1 1 1;
  48. #X connect 3 0 10 0;
  49. #X connect 4 0 6 0;
  50. #X connect 5 0 7 0;
  51. #X connect 6 0 5 0;
  52. #X connect 6 1 5 1;
  53. #X connect 7 0 3 0;
  54. #X connect 7 1 3 1;
  55. #X connect 8 0 24 0;
  56. #X connect 10 0 14 0;
  57. #X connect 11 0 15 0;
  58. #X connect 11 1 26 0;
  59. #X connect 12 0 25 0;
  60. #X connect 13 1 14 1;
  61. #X connect 14 0 8 0;
  62. #X connect 16 0 11 0;
  63. #X connect 17 0 0 1;
  64. #X connect 18 0 4 1;
  65. #X connect 19 0 14 1;
  66. #X connect 25 0 13 0;
  67. #X connect 26 0 29 0;
  68. #X connect 26 1 30 0;
  69. #X connect 26 2 27 0;
  70. #X connect 27 0 28 0;
  71. #X connect 28 0 30 1;
  72. #X connect 28 0 29 1;
  73. #X connect 29 0 0 0;
  74. #X connect 30 0 4 0;