#N struct drawshapes-template float x float y float weasel float dog float cat;
#N canvas 580 151 589 245 12;
#X text 20 206 see also:;
#X obj 164 207 plot;
#X obj 21 10 drawpolygon;
#X obj 21 34 drawcurve;
#X obj 116 11 filledpolygon;
#X obj 117 34 filledcurve;
#N canvas 271 214 944 504 drawshapes-template 0;
#X msg 41 299 1;
#X msg 74 299 0;
#X msg 514 19 1;
#X msg 547 19 0;
#X text 504 83 [filledpolygon] and [filledcurve] take the same inlet input. As for the arguments \, they take an extra first argument to specify interior color. Here we have \; - an interior color of red (900) \; - the outline color controlled by the "dog" field \; - an outline width of 3 \; - the three pair of coordinates that now describe a closed and filled triangle of altitude "cat".;
#X text 139 318 (if no "-v <field-name>" flag was given);
#X text 109 299 <-- inlet sets visibility (1: visible \, 0: invisible);
#X text 12 32 Flags:, f 65;
#X text 12 191 Arguments (numbers or field names like "weasel" below):, f 67;
#X text 26 210 - color (0=black \, 999=white \, 900=red \, 90=green \, 9=blue \, 555=grey \, etc.) \; - line width \; - (x \, y) pairs giving coordinates of each vertice in the shape (at least two pairs are needed to draw a line)., f 65;
#X text 23 378 The example above has the line color 0 (black) that is 5 pixels thick and 3 pairs of coordinates to draw an opened triangle with the height set by "weasel" (this also makes the height settable via click and dragging \, unless flags disable this). the [drawcurve] object below draws a red line over the 3 points using a bezier curve., f 63;
#X text 510 356 The [struct] object below defines the fields for this template. We have 2 of them in the "data" window and you can see their fields' values by right-clicking on the object and selecting "properties". The fields x and y automatically govern the placement of the object as a whole., f 57;
#X obj 588 444 struct drawshapes-template float x float y float weasel float dog float cat, f 42;
#X text 579 18 <-- visibility;
#X obj 556 290 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X text 504 210 The [filledcurve] below is invisible by default via the '-n' flag. Click on the toggle to draw a closed shape over the given points using a bezier curve \, interior color is green (90) and line color is given by the 'cat' field. It;
#X text 582 290 <-- visibility;
#X obj 547 48 filledpolygon 900 dog 3 15 0 25 cat 35 0;
#X obj 556 320 filledcurve -n 90 cat 8 -50 125 50 250 150 125;
#X obj 206 464 drawcurve 900 3 -10 0 25 dog 60 0;
#X obj 74 345 drawpolygon 0 5 0 0 25 weasel 50 0;
#X text 12 7 Creation arguments for [drawpolygon] and [drawcurve]:;
#X text 26 51 - "-n": make invisible initially \; - "-v [const or name]": assign a field to set visibility \; - "-xv": disable dragging vertices when in "run" mode (but keep reporting mouse clicks) \; - "-xr": disable all mouse actions when in "run" mode \; - "-xe": disable all mouse actions when in "edit" mode (all drawing instructions in the scalar need this flag) \; - "-x": set both "-xr" and "-xe" \, disabling all mouse actions (all drawing instructions in the scalar need this flag) \;, f 63;
#X connect 0 0 20 0;
#X connect 1 0 20 0;
#X connect 2 0 17 0;
#X connect 3 0 17 0;
#X connect 14 0 18 0;
#X restore 280 131 pd drawshapes-template;
#N canvas 133 55 428 365 drawshapes-data 1;
#X scalar drawshapes-template 256 92 -53 170 60 \;;
#X scalar drawshapes-template 67 84 72 200 28 \;;
#X coords 0 365 1 364 0 0 0;
#X restore 280 157 pd drawshapes-data;
#X text 222 13 - draw shapes for data structures, f 17;
#X obj 204 207 set;
#X obj 96 207 drawtext;
#X obj 8 67 cnv 1 570 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#N canvas 671 82 573 462 reference 0;
#X obj 6 60 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000 0;
#X obj 6 106 cnv 2 550 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000 0;
#X obj 6 144 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0;
#X obj 5 430 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0;
#X text 117 77 float -;
#X obj 22 10 drawpolygon;
#X obj 22 33 drawcurve;
#X obj 111 10 filledpolygon;
#X obj 111 33 filledcurve;
#X text 143 116 NONE, f 51;
#X text 174 77 sets visibility (1: visible \, 0: invisible)., f 46;
#X obj 6 168 cnv 1 550 1 empty empty flags: 8 12 0 13 #9f9f9f #000000 0;
#X obj 6 319 cnv 1 550 1 empty empty args: 8 12 0 13 #9f9f9f #000000 0;
#X text 80 241 "-xr": disable mouse actions when in "run" mode., f 63;
#X text 80 173 "-n": makes it invisible initially., f 63;
#X text 80 259 "-xe": disable mouse actions when in "edit" mode., f 63;
#X text 80 277 "-x": set both "-xr" and "-xe" \, disabling all mouse actions., f 63;
#X text 97 331 1) float* -;
#X text 98 362 2) float* - line width (default 1)., f 60;
#X text 145 403 * all of the above can also be field names.;
#X text 112 381 3 list* - (x \, y) pairs giving coordinates of each vertice.;
#X text 80 209 "-xv":;
#X text 129 209 disable dragging vertices when in "run" mode (keeps reporting mouse clicks)., f 56;
#X text 182 330 line color \, filled shapes have an extra first interior color (default 0 \, 0)., f 48;
#X text 80 191 "-v": <symbol>: assigns a field to make it visible/invisible., f 63;
#X text 216 9 - draw polygon shapes in a scalar.;
#X text 216 32 - draw shapes with bezier curve in a scalar.;
#X text 80 296 "-d": dragging in interior displaces the entire scalar., f 63;
#X restore 407 22 pd reference;
#X text 505 23 <= click;
#X obj 8 193 cnv 1 570 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#X obj 238 207 get;
#X text 109 130 explanation is here -->;
#X text 73 79 Use these objects to draw straight and curved shapes according in a scalar., f 62;
#X text 370 208 updated for Pd version 0.56;
