#remark
I already check that question, I’m asking about a bit another
I’m trying to load my map from Tiled editor for a couple of days and still cant understand how blit it properly ?
I’m also trying to use pytmx library
I created my map from collection of images , NOT like sprite sheet collection , and now when I’m loading my terrain layer some images dosen’t flipped automatically , but they were flipped in Tiled editor previously …
Can someone recommend me any ideas how realize it PROPERLY with pytmx library ?
I know that info about fliping located in gid (In first three bits of bitwize representation of that number)
but also how ge normal Id from gid ?
Anyway how read throw pytmx data if image need flip or not ?
def map_setup():
global image
# Getting / Importing the map
tmxdata = load_pygame("Tile_files\\mymap2.tmx")
width = tmxdata.width * tmxdata.tilewidth
height = tmxdata.height * tmxdata.tileheight
ti = tmxdata.get_tile_image_by_gid
for layer in tmxdata.visible_layers:
if isinstance(layer, TiledTileLayer):
for x, y, gid, in layer:
tile = ti(gid)
if tile:
image = tmxdata.get_tile_image(x, y, layer)
That is exacted code from stackoverflow , but it dosen’t flip tiles which in layers container …
Will be grateful any recommendation ))