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?
I think you need to use StrFormat instead.
Or even
RawDrawCircle(200,150,StringToInt(radius));
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.
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
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.
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
That is a great idea!!