I added this code
–constans for Rotate and flip tiles
local rot90 = 10485760 --0xA0000000,
local rot180 = 3221225472 --0xC0000000,
local rot270 = 1610612736 --0x60000000,
local flipY = 1073741824 --0x40000000,
local flipX = 2147483648 --0x80000000,
local flipY_Rot90 = 536870912 --0x20000000,
local flipX_Rot90= 3758096384 --0xE0000000,
–On layer.draw function after geting id from tilest I insert this code to identificate the rotation and to get real id
–variable fliped will have the real orientation and flip of tile
…
local id=mapData.layers[i].data[(y-1)*data.mapWidth+x]
smm >>>> Check if tile is flip or rotated
local fliped = false
– Tile is fliped must get real id
if id >= flipY_Rot90 then
if id >= flipY then
if id >= rot270 then
if id >= flipX then
if id >= rot90 then
if id >= rot180 then
if id >= flipX_Rot90 then
fliped = flipX_Rot90
else
fliped = rot180
end
else
fliped = rot90
end
else
fliped = flipX
end
else
fliped = rot270
end
else
fliped = flipY
end
else
fliped = flipY_Rot90
end
id = id - fliped
end
– smm <<<<
–finally when tile is created does rotation or flip
smm >>>> rotate tile if fliped
if fliped then
if fliped == rot90 then
tile.rotation = 90
elseif fliped == rot180 then
tile.rotation = 180
elseif fliped == rot270 then
tile.rotation = 270
elseif fliped == flipY then
tile.yScale = -1
elseif fliped == flipX then
tile.xScale = -1
elseif fliped == flipY_Rot90 then
tile.yScale = -1
tile.rotation = 90
elseif fliped == flipX_Rot90 then
tile.xScale = -1
tile.rotation = 90
end
end
– smm <<<< end if tile is flipped