Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: SilverWizard_OTF on Wed 11/08/2004 19:47:18

Title: RawDrawCircle problems
Post by: SilverWizard_OTF on Wed 11/08/2004 19:47:18
Well, i typed this code:

RawClearScreen(0);
RawSetColor(1981)
string radius;
InputBox("Give the value of the radius",radius);
StringToInt(radius);
RawDrawCircle(200,150,radius);

The problem is that  any number i type,  the computer fills its screen with green (Which is the colour that  should have the circle, by the way).

Can anyone tell me what 's going on?
Title: Re: RawDrawCircle problems
Post by: Scummbuddy on Wed 11/08/2004 19:53:14
I think you need to use StrFormat instead.
Title: Re: RawDrawCircle problems
Post by: SSH on Wed 11/08/2004 19:55:07
Or even

RawDrawCircle(200,150,StringToInt(radius));

Title: Re: RawDrawCircle problems
Post by: SilverWizard_OTF on Wed 11/08/2004 20:01:15
Thanks, SSH!! That worked perfect!
  Well, i still wonder why it didn't worked with RawDrawCircle(200,150,radius), but never mind!

I will try with StrFormat, too.

Title: Re: RawDrawCircle problems
Post by: SSH on Wed 11/08/2004 20:19:51
Becuase radius is declared as a string and so when you pass it to a function, it gives a pointer to the string location. When the function tires to interpret that address as an integer, it gets a very large number and thus draws a very large circle, covering the whole screen. You could laso try:

string radius;
int radiusi;
InputBox("Give the value of the radius",radius);
radiusi=StringToInt(radius);
RawDrawCircle(200,150,radiusi);

but you might as well just nest the functions like I said in my previous post
Title: Re: RawDrawCircle problems
Post by: SilverWizard_OTF on Thu 12/08/2004 14:55:01
OK, thanks.
Just one last question: Is it possible  to create a circle, which won't be filled?
And more than that, to be filled, but with different colour from its  outline?
I have searched, but i couldn't find any function that satisfies these requirements.
Title: Re: RawDrawCircle problems
Post by: MrColossal on Thu 12/08/2004 18:40:16
as far as making an outlined circle, you could try just drawing a black circle and then drawing a green circle in the same exact place as the black circle only a few pixels smaller in diameter.

but no, I don' think you can just make an outlined circle
Title: Re: RawDrawCircle problems
Post by: SilverWizard_OTF on Thu 12/08/2004 19:11:47
That is a great idea!!