Older Newer
Sun, 03 Nov 2019 15:17:38 . . . . SyneRyder [Code formatting for ePub]


Changes by last author:

Added:
= 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 ==

<code>

%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&lt;y_end; y++) {

updateProgress(y,y_end);

for (x=x_start; x&lt;x_end; x++) {

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

for (z=0; z&lt;Z; z++) {

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

}

}

}

return true;

}

</code>

== Also see ==

bRect, bRect2, bTriangle