Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Can I draw filled circles?

Author
Message
Rob from Edinburgh
21
Years of Service
User Offline
Joined: 28th Mar 2003
Location: United Kingdom
Posted: 3rd Apr 2003 11:58
As another newcomer to DarkBASIC I have what is probably a silly beginners' question. I want to write a program which makes sprites on the fly. A part of the sprites would be a circle filled with various colours.

I had thought that this part would be easy, and it probably is but I can't see it. I found that the command Box will draw a filled box on screen.

I want to use Circle to draw a filled circle on screen but, of course, it only draws an empty circle.

I tried drawing lots of concentric circles which get smaller and smaller, ending in a radius of zero but this gives a patchy filled circle.

Can anybody help?

Thanks in advance,

Rob Somerville
Flashing Blade
22
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 3rd Apr 2003 12:58
You want a function - something like this:
Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 3rd Apr 2003 16:10
That'll work, this is a bit quicker though:



Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Rob from Edinburgh
21
Years of Service
User Offline
Joined: 28th Mar 2003
Location: United Kingdom
Posted: 3rd Apr 2003 17:00
Thanks to both of you. I'll try these out as soon as I get home. (we only have Macs at the school where I work)

Shadow
22
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 3rd Apr 2003 18:34
I would have used lines and sines too. I must be learning something.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 3rd Apr 2003 20:27 Edited at: 3rd Apr 2003 20:27
Have a look in the 20 line section, I posted a topic with several functions.

You are the th person to view this signature.
Programmers don't die, they just Gosub without return....
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 3rd Apr 2003 20:41
Hey! I recognise that code Rich.

Have you looked at codebase again recently, or the post in the 20 liners? The new code beats the stuffing out of that older stuff
Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 4th Apr 2003 02:33
I just posted what Lee wrote (it's part of his snippets collection sat on my HD).

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 4th Apr 2003 05:50
I just thought of a quicker way.

make a 3d sphere and turn off its ambience and light settings.

this creates a flat circle then use get image.

Its prolly the fastest solution but may have some limitations due to the creation factor.


think outside the square

Rob from Edinburgh
21
Years of Service
User Offline
Joined: 28th Mar 2003
Location: United Kingdom
Posted: 4th Apr 2003 11:34
I tried out both solutions at home last night with surprising results. Flashingblade's worked perfectly and is fast enough for me. I only need to produce about 10 simple sprites at a time and a few milliseconds delay is no problem.

With rich's code I got the error message,
SYNTAX ERROR, PARAMETERS DIFFER BETWEEN FUNCTION CALL AND DECLARATION

I notice that rich's code is quite a few weeks old and has probably been tested and tried many times without failure. The cause of the problem might be at my end.

I prefer to download at the school where I work (cheaper and quicker) and this might be a problem. I download to a Mac so I copied rich's text and pasted into a Simple text document, saved on a floppy and loaded as a WordPad document at home, copied the text and pasted into an empty DarkBASIC V1.13 file and ran it getting the above error message.

It may be that all the copying and pasting between programs, systems and discs has lost a character or two of rich's code. Perhaps rich wrote in DB Pro. I am sure that I will move to DB Pro later.

I tried mucking about with the code and got it to compile but I could not get it to result in a circle. As I say though Flashingblade's code is fine for my purpose and I thank you both for your help

On checking the DB website this morning I see that quite a few people have good things to say about rich's code so I am even more convinced that the mistake is at my end.

Login to post a reply

Server time is: 2024-11-24 09:01:09
Your offset time is: 2024-11-24 09:01:09