I am loading a map from Tiled with pytmx, but when i draw the tiles, they aren't rotated like in the editor.
The code i'm using to draw the map is this:
tiled_map = pytmx.util_pygame.load_pygame(f"mymap.tmx")
tile_list = []
tile_group = pygame.sprite.Group()
tile_layer = tiled_map.get_layer_by_name("tiles")
for x, y, image in tile_layer.tiles():
tile = Tile(x*self.tiled_map.tilewidth, y*self.tiled_map.tileheight, image=image)
tile_group.add(tile)
tilelist.append(tile)
#later in the code
for tile in tile_list:
sur.blit(tile.image, (tile.x, tile.y))
The tiles all get drawn out in the correct place, but they all have the default rotation, even though they are rotated in Tiled:
I know this question is similar to How to correctly display rotation object with pytmx?, but it did not help me as my problem is with tiles and not objects.
Why are you using a .tmx file to export the map? save the map as CSV, CSV is more accessible a lot than .tmx .tmx is used to save and load it in Tiled not used in rendering the Map
That is what I use
and put this in the while loop