Skip to main content
edited tags
Link
user1430
user1430
Source Link
Rahul Verma
  • 359
  • 3
  • 10

If filled polygon cannot be drawn via libgdx ShapeRenderer , then what is the work around?

I know most of you would suggest me to draw a filled polygon by using combination of triangles and rectangles , but that is not possible for complex shapes . I want to basically draw a generic shape on screen , here it is enter image description here

The above shape needs to be drawn in generic form , i.e -> the width of each trapezium's upper edge is fixed . -> the lower edge of the overall compound shape is a constant unit greater than upper edge. -> this whole compound shape can have arbitrary length and thus number of individual trapeziums that compose the compound shape is not fixed. I wish to draw each colored trapezium as a filled polygon . Is there any way of achieving this