Is it possible, even with a workaround, to make AGS draw an unfilled circle, rather than the filled ones it draws currently.Ã, The ability of the engine to do this is crucial to the user-end of my game...
-Thanks in advance, Akumayo
Of course, using the RawDrawLine function.
[EDIT] Heh, I started writing it with radians, but then changed it half way because I was sure CJ had "dumbed down" the functions to take degrees :) Silly me. Code erased because Wretched's is obviously better (and working!).
Maths.Sin() and cos() use radians. Also you could get a duplicate arc due to floating point precision with < 360.0
function RawDrawUnfilledCircle(int x, int y, int radius)
{
Ã, float farcs;
Ã,Â
Ã, float fradius=IntToFloat(radius);
Ã, float t0;
Ã, float t1;
Ã, farcs=2.0*Maths.Pi*fradius/10.0; //Try to keep big circles smooth
Ã, farcs=IntToFloat(FloatToInt(farcs));
Ã, if (farcs<18.0)
Ã, {
Ã, Ã, Ã, farcs=18.0;
Ã, }
Ã,Â
Ã,Â
Ã, float a=0.0;
Ã, while (a<farcs)
Ã, {
Ã, Ã, t0=(a)*Maths.Pi*2.0/farcs;
Ã, Ã, t1=(a+1.0)*Maths.Pi*2.0/farcs;
Ã, Ã,Â
Ã, Ã, RawDrawLine(x+FloatToInt(fradius*Maths.Cos(t0)),
Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, y+FloatToInt(fradius*Maths.Sin(t0)),
Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, x+FloatToInt(fradius*Maths.Cos(t1)),
Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, y+FloatToInt(fradius*Maths.Sin(t1)) );
Ã, Ã, a=a+1.0;
Ã, }
}
Wow Wretched! Thanks alot. Now I know how to go about scripting something like this!