bRect2

Syntax

int bRect2(int x, int y, int topx, int topy, int bottomx, int bottomy)

Arguments

x, y
Current x and y coordinates in the image
topx, topy
Coordinates of the top left corner of the rectangle
bottomx, bottomy
Coordinates of the bottom right corner of the rectangle

Return

If the supplied x and y values lie within the defined rectangle a value of 1 will be returned, otherwise 0.

Description

Lets you easily draw a rectangle on the image.

Example

%ffp 

ctl(0): "Top X",val=64
ctl(1): "Top Y",val=64
ctl(2): "Bottom X",val=128
ctl(3): "Bottom Y",val=128

ForEveryTile:
{
	int Draw;

	for (y=y_start; y<y_end; y++){
		updateProgress(y,y_end);
	for (x=x_start; x<x_end; x++){ 

		Draw= bRect2 (x,y,ctl(0),ctl(1),ctl(2),ctl(3));

	for (z=0; z<Z; z++){ 

		if (Draw) pset(x,y,z,255);

	}}}

	return true;
}

Also see

bCircle, bRect, bTriangle

Comments

Everyone can add his comments about his experiences with this function here. Tips for using it are welcome, too.