earlygrey / shapedrawer

A library for libGDX that draws simple shapes using a batch.
MIT License
187 stars 31 forks source link

Dotted lines? #53

Closed Isolyth closed 2 years ago

Isolyth commented 2 years ago

Any plans for dotted line support? Dotted polygons?

earlygrey commented 2 years ago

I don't have any plans to add it - it would be a bit complicated to get this working with line joins. I'd consider a PR with it, but it would be best to come up with a plan first on how to deal with line joins and how it would be integrated it into the current code.

earlygrey commented 2 years ago

Closing this now - if someone is willing to do the work reopen and post your ideas.

Frosty-J commented 1 year ago

In the meantime, I am using juwalbose's GraphicsLineRenderer for dashed lines (haven't investigated dotted but the repo also has that). Comment out the textures you don't need, download the ones you do need from core/assets and add Gdx.gl.glEnable(GL20.GL_BLEND) for transparency. Gdx.gl.glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA) seems to remove the dark outline around it, but at small sizes the lines are so aliased you might as well just disable linear texture filtering instead. I may try replacing dashedline.png later into the development of my (jam) game.