bCircle

Syntax

int bCircle(int x, int y, int centerx, int centery, int radius)

Arguments

x, y
Current x and y coordinates in the image
centerx, centery
Center coordinates of the circle
radius
Radius of the circle

Return

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

Description

Lets you easily draw a circle on the image.

Example

%ffp 

ctl(0): "Center X",range=(0,255),val=128
ctl(1): "Center Y",range=(0,255),val=128
ctl(2): "Radius",range=(0,128),val=64

ForEveryTile:
{

	int Draw;


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

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

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

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

	}}}

	return true;
}

Also see

bRect, bRect2, bTriangle

Comments

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