- Code: Select all
`#define pi 3.14159265359`

void draw_circle_filled(int X, int Y, int R, int G, int B, double A, double rad, int smooth)

{

double i;

moveto(X, Y);

setpen(R, G, B, A, 3+smooth);

for(i=0;i<pi*2;i+=pi/rad/(pi/3))

{

moveto(X, Y);

lineto(X+cos(i)*rad, Y+sin(i)*rad);

}

}

void draw_circle(int X, int Y, int R, int G, int B, double A, double rad, int smooth)

{

double i;

moveto(X, Y);

setpen(R, G, B, A, 1+smooth);

for(i=0;i<pi*2;i+=pi/rad/(pi))

{

putpixel(X+cos(i)*rad, Y+sin(i)*rad);

}

}

Copy and paste this to the global code area in game-editor.

to draw a non-filled Circle, use this:

draw_circle(x, y, r, g, b, tra, radius, smoothing);

the smoothing value makes it slightly larger.

to make a filled circle, use this:

draw_circle_filled(x, y, r, g, b, tra, radius, smoothing);

likewise the smoothing value makes it smoother.

Screenshots:

seen above.