https://wiki.inspired-lua.org/index.php?title=gc:drawRect&feed=atom&action=historygc:drawRect - Revision history2024-03-28T10:51:57ZRevision history for this page on the wikiMediaWiki 1.33.0https://wiki.inspired-lua.org/index.php?title=gc:drawRect&diff=499&oldid=prevAdriweb: Created page with "gc:'''drawRect''' is a function that is part of the gc (Graphics Context). Draws a rectangle at coordinates (x,y) with the “x” side being “xwidth” long ..."2011-07-11T11:50:12Z<p>Created page with "gc:'''drawRect''' is a function that is part of the <a href="/Category:gc" title="Category:gc">gc</a> (Graphics Context). Draws a rectangle at coordinates (x,y) with the “x” side being “xwidth” long ..."</p>
<p><b>New page</b></p><div>gc:'''drawRect''' is a function that is part of the [[:Category:gc|gc]] (Graphics Context).<br />
<br />
Draws a rectangle at coordinates (x,y) with the “x” side being “xwidth” long and the “y” side being “yheight” long.<br />
<br />
{{Since|3.0}}<br />
<br />
== Syntax ==<br />
gc:'''drawRect'''(x, y, xwidth, yheight) <br />
<br />
{| class="wikitable"<br />
|-<br />
! Parameter !! Type !! Description<br />
|-<br />
| <u><center>x</center></u> || number || The x-coordinate of the top-left point.<br />
|-<br />
| <u><center>y</center></u> || number || The y-coordinate of the top-left point.<br />
|-<br />
| <u><center>xwidth</center></u> || number || The width of the rectangle<br />
|-<br />
| <u><center>yheight</center></u> || number || The height of the rectangle<br />
|}<br />
<br />
<br />
== Example == <br />
<syntaxhighlight><br />
gc:drawRect(0,0,100,100)<br />
</syntaxhighlight><br />
<br />
This draws a recatngle (square, actually) whose points are at the given coordinates.<br />
This code does the same thing as :<br />
[[gc:drawPolyLine]]({0,0, 0,100, 100,100, 100,0, 0,0}).<br />
<br />
<br /><br /><br />
<br />
<br />
== See also ==<br />
*[[gc:drawPolyLine]]<br />
<br />
<br /><br /><br />
<br />
<br />
[[Category:gc]]</div>Adriweb