Must I use DrawPoly to draw a non-filled rect?
BlitzMax Forums/BlitzMax Beginners Area/Must I use DrawPoly to draw a non-filled rect?
| ||
I miss the solid = true flag at the end of Rect (Now DrawRect). Is there something I missed in the docs? Thanks Russell |
| ||
Nope, no fill flag although many people have created a simple function to do the same with lines. |
| ||
Just draw 4 lines. or...In OpenGL ... this might not be entirely accurate...untested glBegin(GL_LINES) glvertex2i(x+1,y) glvertex2i(x+width-1,y) 'first line glvertex2i(x+width-1,y+1) glvertex2i(x+width-1,y+height-2) 'second line glvertex2i(x+1,y+height-2) glvertex2i(x+width-1,y+height-1) 'third line glvertex2i(x,y) glvertex2i(x,y+height-1) 'fourth line glEnd() |
| ||
better yet, use Indiepaths Poly Module. |
| ||
Shouldn't this be a defult feature? I mean, a NON solid rect, is it that obscure that Mark didn't think of it? come on |
| ||
I think Mark is busy (rightly or wrongly) on other things. The response to this query As it appears in the Wiki can we assume there will NEVER be an unfilled option and we should use the polygon mode workaround? produced this response... If there's a demand for something (and esp. if it's easy!) it'll probably get done eventually. This one's easy so look out for it soon. over a year ago. |
| ||
Sorry, but that response doesn't hold water, since this feature was already available in the other Blitz products (even going back to Blitz 2D, I believe). Of course there was/is a demand for it! <shakes head> I can use DrawPoly, of course, but saying True or False as a parameter of DrawRect sure would be easier... Russell |
| ||
I posted it purely because it *doesn't* hold water. I'm glad the irony wasn't lost in written form :) |
| ||
Wow! So much fuss over 4 LINES! |
| ||
Enay, and if the topic was unfilled DrawOval? |
| ||
I think unfilled rect and unfilled oval should've been in the original Max2D, they are pretty standard fare and very simple to do. It's because they're so simple to do, that 4 lines of code IS indeed not much to fuss over, which is why they should've been included. I uploaded an unfilled oval routine to the code archives under BlitzMax Graphics routines. The only thing it doesn't do is rotate well. Any even basic graphics library should have Plot, DrawRect, DrawOval, DrawUnfilledRect, DrawUnfilledOval, Point (read the pixel color) and Cls. |