VGA

drawRect()

Description

Draws a rectangle in the screen.

Syntax

VGA.drawRect( x, y, width, height )

Parameters

x - x coordinate of rectangle
y - y coordinate of rectangle
width - width of rectangle from x
height - height of rectangle from y

Returns

none

Example

const int board_x0 = 40;
const int board_y0 = 5;
const int blocks_x = 10;
const int blocks_y = 20;
const int blocksize = 5;

unsigned offsety = board_y0 + ( y * blocksize );

int i;
for ( i=0; i<4; i++ )
{

VGA.setColor( YELLOW );
VGA.drawRect( board_x0, offsety, blocksize * blocks_x, blocksize );
waitTick();
VGA.setColor( RED );
VGA.drawRect( board_x0, offsety, blocksize * blocks_x, blocksize );
waitTick();

}
VGA.setColor( GREEN );

See also

  

Share |