Skip to main content
2 of 3
Trimmed duplication, unnecessarily lengthy expressions and irrelevant information. Formatting for clarity.
Anko
  • 13.4k
  • 10
  • 55
  • 82

How do I render a rounded rectangle in libgdx?

I've been thinking of ways to render a rounded rectangle in libgdx. I haven't found a pre-built way in the documentation. I've looked at:

  • ShapeRenderer, but that's apparently quite expensive performance-wise and I'll have to compose it of a polygon perhaps or use circles and rectangles.
  • The Mesh class, which would probably perform well but is complex to use for such a simple shape. Again, I'd have to create the polygon myself with an algorithm for different sizes of rounded rectangles.

Can someone point me in the right direction?

lostpebble
  • 143
  • 1
  • 4