• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM [Solved] Roundrect outline thickness?

MeBoingus

Member
Howdy all,

I'm currently stuck on something that I thought would be super basic. I'm trying to draw an outline around a roundrect, with a certain 'thickness.'

Normally, if I want a specific outline width drawn as a square, I'll simply use draw_line_width. However, for obvious reasons I cannot do that in the case of a roundrect.

A few extra draw calls won't be a huge issue in this case, as there are only a few of these being drawn at any given time.

Does anyone know of a method to achieve this?
 

MeBoingus

Member
Would it produce good enough results to draw two roundrects, one as the border?
Sadly no. I need to be able to adjust the thickness of the outline, and using one as the border means a 1px outline.

The other idea I had was to draw as many as were needed for a specific thickness. I.E. I draw a roundrect for the background, and then draw X amount more at 1 pixel increments. However, this leaves noticeable gaps whenever the corners don't meet up perfectly.

Example.png
 
Top