Difference between revisions of "gc:fillRect"

From Inspired-Lua Wiki
Jump to navigation Jump to search
(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...")
 
 
Line 2: Line 2:
  
 
Draws a color-filled rectangle at coordinates (x,y) with the “x” side being “xwidth” long and the “y” side being “yheight” long.
 
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}}
 
{{Since|3.0}}
Line 20: Line 21:
 
| <u><center>yheight</center></u> || number || The height of the rectangle
 
| <u><center>yheight</center></u> || number || The height of the rectangle
 
|}
 
|}
 
  
 
== Example ==  
 
== Example ==  
Line 30: Line 30:
 
This code does the same thing as :
 
This code does the same thing as :
 
[[gc:fillPolygon]]({0,0, 0,100, 100,100, 100,0, 0,0}).
 
[[gc:fillPolygon]]({0,0, 0,100, 100,100, 100,0, 0,0}).
 
<br /><br />
 
  
 
== See also  ==
 
== See also  ==
 
*[[gc:fillPolygon]]
 
*[[gc:fillPolygon]]
  
<br /><br />
 
  
 
[[Category:gc]]
 
[[Category:gc]]

Latest revision as of 06:37, 6 August 2011

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 “xwidth” long and the “y” side being “yheight” long.


This has been introduced in TI-Nspire OS 3.0 (Changes).


Syntax

gc:fillRect(x, y, xwidth, yheight)

Parameter Type Description
x
number The x-coordinate of the top-left point.
y
number The y-coordinate of the top-left point.
xwidth
number The width of the rectangle
yheight
number The height of the rectangle

Example

gc:fillRect(0,0,100,100)

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}).

See also