Files
processing4/web/reference/API/rectMode.xml
2005-01-27 06:48:42 +00:00

55 lines
1.4 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>rectMode()</name>
<category>Shape</category>
<subcategory>2D Primitives</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image>rectMode_.gif</image>
<code>
rectMode(CENTER);
rect(35, 35, 50, 50);
rectMode(CORNER);
fill(102);
rect(35, 35, 50, 50);
</code>
</example>
<description>
Modifies the location from which rectangles draw. The default mode is <b>rectMode(CORNER)</b>, which specifies the location to be the upper left corner of the shape and uses the third and fourth parameters of <b>rect()</b> to specify the width and height. The syntax <b>rectMode(CORNERS)</b> uses the first and second parameters of <b>rect()</b> to set the location of one corner and uses the third and fourth parameters to set the opposite corner. The syntax <b>rectMode(CENTER)</b> draws the image from its center point and uses the third and forth parameters to <b>rect()</b> to specify the image's width and height. The parameter must be written in "ALL CAPS" because Processing is a case sensitive language.
</description>
<syntax>
rectMode(<c>MODE</c>)
</syntax>
<parameter>
<label>MODE</label>
<description>Either CORNER, CORNERS, CENTER</description>
</parameter>
<returns>None</returns>
<related>
rect()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>