i’m having really weird behavior loading in tilemaps.
i’m using tiled, exporting to a .lua file
the bitflags for the transformation matrix of tiles seems to be off.
there seems to be an erroneous addition of a flip sometimes
below are some test squares, rows from top to bottom: none, vertical flip, horizontal flip, both flips). columns from left to right: none, rotated clockwise once, twice, three times
how it shows up in tiled (how it should look):
how it shows up in game (not so good):
my code for getting the transform matrix (and tile id too):
local function extracttile(tilenum)
local tile=bit.band(0xFFFFFFF,tilenum)
local flags=tilenum-tile
flags=bit.rshift(flags, 28)
local rflags=0
local hf,vf,r9=false,false,false
hf= (bit.band(flags,8)>1) --hlfip
vf= (bit.band(flags,4)>1) --vflip
r9= (bit.band(flags,2)>1) --rotation
rflags=(hf and tilemap.H_FLIP or 0) + (vf and tilemap.V_FLIP or 0) + (r9 and tilemap.ROTATE_90 or 0)
return tile,rflags
end
is the problem with defold not handling transforms correctly or is it with tiled not exporting properly, or is it my code being bad?