Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 16:47 19 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : POLYGON command is bugging me

Author Message
danielkos
Newbie

Joined: 10/07/2021
Location: Australia
Posts: 25
Posted: 09:32am 03 Sep 2021
Copy link to clipboard 
Print this post

I like the fact that I can pass the POLYGON command a whole set of polygons to render in one go. However, I have a set of polygons to be rendered where some have both an outline and a fill colour, and others only require an outline. The polygon command seems to differ from certain other drawing commands in that a fill colour of -1 does not mean "no fill specified", it's simply invalid.

This is causing me a headache right now as I've written some subroutines to load a set of 'game objects' from files (where each 'object' consists of a set of polygons to be rendered at a certain spot on screen), and populate arrays that can be passed to the POLYGON command for quick rendering of all the polygons in the 'object' at once, but there seems to be no way for me to represent 'no fill' when specifying the fill colour: I was hoping to just use -1 but the POLYGON command doesn't accept that.

I was wondering if there might be a possible workaround, like a colour value that could be treated as transparent (I'm using 8-bit colour mode), or a value that means "argument not specified", to save me having to explicitly call the appropriate form of POLYGON command for each polygon to be rendered.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10610
Posted: 09:43am 03 Sep 2021
Copy link to clipboard 
Print this post

The polygon command works the same as all the other shape drawing commands. If a fill colour is specified you get a fill if not you get an outline (e.g. box, rbox, circle). Sorry but this is core MMbasic functionality. TEXT is a special case where -1 specifies not to draw the background colour which is the default
 
danielkos
Newbie

Joined: 10/07/2021
Location: Australia
Posts: 25
Posted: 09:50am 03 Sep 2021
Copy link to clipboard 
Print this post

OK. Does this mean there's no possible way to combine filled and unfilled polygons in a single call to the POLYGON command (when running the command on a set of multiple polygons, outline and fill-colour arrays)?
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025