gil_px2gu-help.pd 1.0 KB

12345678910111213141516171819202122232425262728
  1. #N canvas 656 114 482 474 10;
  2. #X floatatom 234 340 5 0 0 0 x - -;
  3. #X floatatom 283 340 5 0 0 0 y - -;
  4. #X text 157 416 (c) 2012 Marian Weger;
  5. #X text 30 49 converts coordinates from gem units to pixels;
  6. #X text 320 24 e.g. 800 600;
  7. #X floatatom 234 209 5 0 0 0 x - -;
  8. #X floatatom 283 209 5 0 0 0 y - -;
  9. #X msg 348 180 dimen 800 600;
  10. #X msg 363 211 800 600;
  11. #X text 355 255 gemwin dimensions;
  12. #X text 31 21 gil_px2gu <gemwin dimen x> <gemwin dimen y>;
  13. #X text 35 134 [gil_px2gu] can be used in conjunction with the [gemmouse]
  14. object to scale the cursor coordinates.;
  15. #X text 35 74 [gil_px2gu] takes coordinates given in pixels by inlets
  16. 1 (x) and 2 (y) \, and converts them to gem units. For doing that \,
  17. it needs to know the current gemwin dimension by either creation arguments
  18. or the third inlet.;
  19. #X text 32 209 Cursor position in pixels:;
  20. #X text 32 339 Cursor position in GEM units:;
  21. #X obj 234 276 gil_px2gu 800 600;
  22. #X connect 5 0 15 0;
  23. #X connect 6 0 15 1;
  24. #X connect 7 0 15 2;
  25. #X connect 8 0 15 2;
  26. #X connect 15 0 0 0;
  27. #X connect 15 1 1 0;