gil_mouseover_rectangle.pd 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. #N canvas 331 22 654 748 10;
  2. #X obj 100 708 change;
  3. #X obj 73 307 t l l;
  4. #X obj 305 225 sel 0;
  5. #X obj 73 796 outlet cursor-list;
  6. #X obj 73 276 inlet cursor-list;
  7. #X text 201 815 outlet 2: 1 if cursor inside r \, 0 if cursor outside
  8. r;
  9. #X text 353 652 (c)2011 Marian Weger /part of GIL/;
  10. #X obj 200 796 outlet mouseover;
  11. #X obj 355 577 cnv 15 220 50 empty empty HELP? 20 12 0 14 -261234 -258113
  12. 0;
  13. #X text 356 604 for further help: see [gil_example];
  14. #X text 66 17 gil_mouseover_rectangle <size x> <size y>;
  15. #X obj 503 286 inlet rect size;
  16. #X text 501 267 inlet 3: rectangle size (x y);
  17. #X obj 305 201 float \$1;
  18. #X obj 365 225 sel 0;
  19. #X obj 338 173 t b b;
  20. #X obj 338 151 loadbang;
  21. #X obj 347 250 pack 1 1;
  22. #X obj 100 433 t f f;
  23. #X obj 157 570 < 1;
  24. #X obj 100 570 > 1;
  25. #X obj 347 355 unpack f f;
  26. #X obj 347 416 t b f b f;
  27. #X obj 273 378 t f f;
  28. #X obj 273 498 -;
  29. #X obj 300 498 +;
  30. #X obj 110 540 t b f;
  31. #X obj 157 540 t b f;
  32. #X obj 100 622 &&;
  33. #X obj 157 592 t b f;
  34. #X obj 100 682 &&;
  35. #X obj 200 644 t b f;
  36. #X obj 200 433 t f f;
  37. #X obj 257 570 < 1;
  38. #X obj 200 570 > 1;
  39. #X obj 457 416 t b f b f;
  40. #X obj 413 416 t f f;
  41. #X obj 413 496 -;
  42. #X obj 440 496 +;
  43. #X obj 210 540 t b f;
  44. #X obj 257 540 t b f;
  45. #X obj 200 622 &&;
  46. #X obj 257 592 t b f;
  47. #X obj 273 286 inlet pos_x;
  48. #X obj 413 286 inlet pos_y;
  49. #X text 63 48 [gil_mouseover_rectangle] detects \, if the cursor hovers
  50. over a given rectangle inside the gemwin. When the cursor enters the
  51. rectangle \, and the left button is not pressed since the cursor has
  52. been outside the rectangle \, a '1' is sent to the 2nd outlet. By leaving
  53. the rectangle \, having the left mouse button unpressed \, the 2nd
  54. outlet gets a '0'. The rectangle dimensions can be given by either
  55. by creation arguments or 3rd inlet.;
  56. #X obj 100 329 unpack f f;
  57. #X obj 365 201 float \$2;
  58. #X connect 0 0 7 0;
  59. #X connect 1 0 3 0;
  60. #X connect 1 1 46 0;
  61. #X connect 2 1 17 0;
  62. #X connect 4 0 1 0;
  63. #X connect 11 0 21 0;
  64. #X connect 13 0 2 0;
  65. #X connect 14 1 17 1;
  66. #X connect 15 0 13 0;
  67. #X connect 15 1 47 0;
  68. #X connect 16 0 15 0;
  69. #X connect 17 0 21 0;
  70. #X connect 18 0 20 0;
  71. #X connect 18 1 19 0;
  72. #X connect 19 0 29 0;
  73. #X connect 20 0 28 0;
  74. #X connect 21 0 22 0;
  75. #X connect 21 1 35 0;
  76. #X connect 22 0 24 0;
  77. #X connect 22 1 24 1;
  78. #X connect 22 2 25 0;
  79. #X connect 22 3 25 1;
  80. #X connect 23 0 24 0;
  81. #X connect 23 1 25 0;
  82. #X connect 24 0 26 0;
  83. #X connect 25 0 27 0;
  84. #X connect 26 0 20 0;
  85. #X connect 26 1 20 1;
  86. #X connect 27 0 19 0;
  87. #X connect 27 1 19 1;
  88. #X connect 28 0 30 0;
  89. #X connect 29 0 28 0;
  90. #X connect 29 1 28 1;
  91. #X connect 30 0 0 0;
  92. #X connect 31 0 30 0;
  93. #X connect 31 1 30 1;
  94. #X connect 32 0 34 0;
  95. #X connect 32 1 33 0;
  96. #X connect 33 0 42 0;
  97. #X connect 34 0 41 0;
  98. #X connect 35 0 37 0;
  99. #X connect 35 1 37 1;
  100. #X connect 35 2 38 0;
  101. #X connect 35 3 38 1;
  102. #X connect 36 0 37 0;
  103. #X connect 36 1 38 0;
  104. #X connect 37 0 39 0;
  105. #X connect 38 0 40 0;
  106. #X connect 39 0 34 0;
  107. #X connect 39 1 34 1;
  108. #X connect 40 0 33 0;
  109. #X connect 40 1 33 1;
  110. #X connect 41 0 31 0;
  111. #X connect 42 0 41 0;
  112. #X connect 42 1 41 1;
  113. #X connect 43 0 23 0;
  114. #X connect 44 0 36 0;
  115. #X connect 46 0 18 0;
  116. #X connect 46 1 32 0;
  117. #X connect 47 0 14 0;