Changes

Jump to navigation Jump to search

gc:fillRect

1,038 bytes added, 07:36, 6 August 2011
Created page with "gc:'''fillRect''' is a function that is part of the gc (Graphics Context). Draws a color-filled rectangle at coordinates (x,y) with the “x” side being “xw..."
gc:'''fillRect''' is a function that is part of the [[:Category:gc|gc]] (Graphics Context).

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

{{Since|3.0}}

== Syntax ==
gc:'''fillRect'''(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:fillRect(0,0,100,100)
</syntaxhighlight>

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

<br /><br />

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

<br /><br />

[[Category:gc]]

Navigation menu