'pytmx import polygon shape?
I have a polygon shape in tiled that I want to import into pygame via pytmx.
What I have so far in the setup:
tmx_data = load_pygame('../maps/terrain_test.tmx')
objects = tmx_data.get_layer_by_name('object')
and then in game loop:
for obj in objects:
points = [(point.x,point.y) for point in obj.as_points]
pygame.draw.polygon(screen,'red',points)
This does draw something but it always returns a rectangular shape (I assume the bounding box of the polygon) but there seems to be no way to access the points of the polygon itself. If someone knows how to get them, or if it is possible at all, that would be super helpful.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
