RawDrawCircle problems

Started by SilverWizard_OTF, Wed 11/08/2004 19:47:18

Previous topic - Next topic

SilverWizard_OTF

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?
"All we have to decide is what to do, with the time that is given to us"

Scummbuddy

I think you need to use StrFormat instead.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

SSH

Or even

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

12

SilverWizard_OTF

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.

"All we have to decide is what to do, with the time that is given to us"

SSH

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
12

SilverWizard_OTF

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.
"All we have to decide is what to do, with the time that is given to us"

MrColossal

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
"This must be a good time to live in, since Eric bothers to stay here at all"-CJ also: ACHTUNG FRANZ!

SilverWizard_OTF

"All we have to decide is what to do, with the time that is given to us"

SMF spam blocked by CleanTalk