Open thelsing opened 3 years ago
I think this would be a reasonably simple addition, you could just implement it as you have - draw filled circles for a CAP_ROUND enum and extend the line for a CAP_ROUND enum. There's already a JoinType enum, perhaps JOIN_ROUND could be added to that.
Since there are already so many overloaded drawing methods, the cap type might be best just set via drawer.setLineCapType()
or something rather than adding it as an argument to line()
.
Any new thoughts on this? It would be useful for me - I've been using the same workaround as OP, though it doesn't seem the most efficient approach in the world and prevents the use of transparency.
I'm porting a game from java 2d to libgdx. For lines I'm missing some parts of https://docs.oracle.com/javase/7/docs/api/java/awt/BasicStroke.html
As a workaround I draw lines a half a linewith longer on each side for CAP_SQUARE and draw filled circles on each side for CAP_ROUND.
For JOIN_ROUND I also draw circles on the points of the polygon.
I would be nice if I could set the the line end cap and the joins on the Shapedrawer object and have the line and path drawings use them automatically.