Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more joins and caps #37

Open
thelsing opened this issue May 16, 2021 · 2 comments
Open

Add more joins and caps #37

thelsing opened this issue May 16, 2021 · 2 comments

Comments

@thelsing
Copy link

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.

@earlygrey
Copy link
Owner

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().

@Frosty-J
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants