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.

DarkBASIC Discussion / Efficient circles and rounded boxes

Author
Message
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 21st Aug 2009 02:44
Efficient Circles
This function draws circles with a solid circumference using the minimum dots required. Designed for use with memblocks.


TGC Forum - converting error messages into sarcasm since 2002.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 21st Aug 2009 02:46 Edited at: 25th Aug 2009 02:39
Rounded Boxes


TGC Forum - converting error messages into sarcasm since 2002.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 21st Aug 2009 03:09
Sorry about the lack of annotation on the second one, I had to fit it into this stupid word limit. (still no laptop )
Hope you get some use out of these functions. I didn't know I could do the maths to figure this out, my brain went off on a coding frenzy and just did it. Does this ever happen to anyone else? Do you code something and then look at the code and not understand what you've done? haha

TGC Forum - converting error messages into sarcasm since 2002.
Zombie 20
17
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 21st Aug 2009 04:37
Obese, you always amaze me with your coding skill. Cheers.

Zombinos


Coffee coffee coffee coffee coffee coffee cappacino, JAVA!
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 22nd Aug 2009 00:27
Quote: "Obese, you always amaze me with your coding skill. Cheers."

Wow you haven't posted for a while!
Thanks, I amazed myself haha. Is 6.28 a radian? I remember Latch talking about radians and for some reason that number just clicked as I was writing this.
I actually got the idea from someone's sig that shows a 1 diameter circle rolling along a line and it covers 3.14 units in a complete turn.

TGC Forum - converting error messages into sarcasm since 2002.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 24th Aug 2009 01:52
no one seems that interested...
has this been done before?

TGC Forum - converting error messages into sarcasm since 2002.
Zombie 20
17
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 24th Aug 2009 04:42
Its not that its not interesting, I just have a mac right now so I can't put it to good use .

But really keep it up I look forward to your posts


Coffee coffee coffee coffee coffee coffee cappacino, JAVA!
jeffhuys
17
Years of Service
User Offline
Joined: 24th May 2006
Location: No cheesy line here.
Posted: 24th Aug 2009 11:22
Could you port it to DBP?
Sounds really good!

You're the 'th to view this signature!
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 24th Aug 2009 20:36
@Jeffhuys
Have you tested them?
It will probably work in DBPro as is.

TGC Forum - converting error messages into sarcasm since 2002.
jeffhuys
17
Years of Service
User Offline
Joined: 24th May 2006
Location: No cheesy line here.
Posted: 24th Aug 2009 22:19 Edited at: 24th Aug 2009 22:19
It does'nt
This is what I see:



You're the 'th to view this signature!

Attachments

Login to view attachments
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 25th Aug 2009 00:49 Edited at: 25th Aug 2009 00:51
does that happen for both?
I don't have DBP but it might be where I set ink to -2,0 try changing that to rgb(255,255,255),0

TGC Forum - converting error messages into sarcasm since 2002.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 25th Aug 2009 01:08
The rounded corners only draws the flat part of the box with missing corners when I run it in DBC. The circle works.

Quote: "Is 6.28 a radian"

Well, 360 degrees = approxiamately 6.28 radians. 180 degrees = PI radians (3.14) .

Enjoy your day.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 25th Aug 2009 02:42
Quote: "Well, 360 degrees = approxiamately 6.28 radians. 180 degrees = PI radians (3.14) ."

Oh yeah pi2 radians is 360 degrees, I'm sure I've seen that somewhere.

I found a pesky typo, I put "dotsperqrt#" instead of "dotsperqtr#".
Hopefully it will work now. My codey sense is tingling so I think it will

TGC Forum - converting error messages into sarcasm since 2002.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 26th Aug 2009 02:35
The rounded box works now. But I had to adjust the case statments each time so it wouldn't throw an exception by adding spaces before and after the :



Enjoy your day.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 26th Aug 2009 15:34
thanks
i had to squish the code to get it in one post

TGC Forum - converting error messages into sarcasm since 2002.
Phaelax
DBPro Master
21
Years of Service
Recently Online
Joined: 16th Apr 2003
Location: Metropia
Posted: 29th Aug 2009 23:24
DBC doesn't work for me, keeps saying unrecognized parameter on line 50:


It's probably on another line, but it all looks fine to me.


Change these lines and it'll work in DBP. Pro won't draw boxes where the coordinates are the same pixel, must have coordinates from X to at least X+1 to see results.



[url="http://www.nocleanfeed.com"][/url]
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 30th Aug 2009 20:24
@Phalanx
Quote: "DBC doesn't work for me, keeps saying unrecognized parameter on line 50:"


For some reasoon, case throws an exception when there is no space around the ':' when the condition is all on one line. Change the case statements to read as follows



Enjoy your day.
Dark Dragon
16
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 7th Sep 2009 00:38
WoW Obese, Ur Coding ProwRess Is Out the Door, You are a Coding God.

The Rounded boxes really caught my eye! Nice....

(\__/) HHAHAHAHAHAH!
(O.o ) / WORLD DOMINATION!!!!!!!!!!
(> < )
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 9th Sep 2009 02:08
Thanks DD, I played around with the boxes and made a circle that expands into a box when you click it, might be able to use that in some sort of gui.

@Phaelax - did it work with latch's help?
Quote: "@Phalanx"

haha just spotted that.

TGC Forum - converting error messages into sarcasm since 2002.
Phaelax
DBPro Master
21
Years of Service
Recently Online
Joined: 16th Apr 2003
Location: Metropia
Posted: 10th Sep 2009 03:09
Yes it worked.

Oddly, Phalanx was what I was going for when I came up with this name. I couldn't remember it exactly and ended up with Phaelax. (Phalanx is from an xmen comic)

demons breath
20
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 12th Oct 2009 04:36
I always thought your name was a reference to a Phalanx too - always thought it was something to do with Roman soldiers in formation though...

"A West Texas girl, just like me"
-Bush

Login to post a reply

Server time is: 2024-05-03 17:56:52
Your offset time is: 2024-05-03 17:56:52