Changes

Jump to navigation Jump to search

gc:drawRect

1,022 bytes added, 13:50, 11 July 2011
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 ..."
gc:'''drawRect''' is a function that is part of the [[:Category:gc|gc]] (Graphics Context).

Draws a rectangle at coordinates (x,y) with the “x” side being “xwidth” long and the “y” side being “yheight” long.

{{Since|3.0}}

== Syntax ==
gc:'''drawRect'''(x, y, xwidth, yheight)

{| class="wikitable"
|-
! Parameter !! Type !! Description
|-
| <u><center>x</center></u> || number || The x-coordinate of the top-left point.
|-
| <u><center>y</center></u> || number || The y-coordinate of the top-left point.
|-
| <u><center>xwidth</center></u> || number || The width of the rectangle
|-
| <u><center>yheight</center></u> || number || The height of the rectangle
|}


== Example ==
<syntaxhighlight>
gc:drawRect(0,0,100,100)
</syntaxhighlight>

This draws a recatngle (square, actually) whose points are at the given coordinates.
This code does the same thing as :
[[gc:drawPolyLine]]({0,0, 0,100, 100,100, 100,0, 0,0}).

<br /><br />


== See also ==
*[[gc:drawPolyLine]]

<br /><br />


[[Category:gc]]

Navigation menu