This commit is contained in:
asrael 2025-11-01 12:39:59 -05:00
parent e862b02019
commit 0ed7fc4496
No known key found for this signature in database
GPG key ID: 2786557804DFAE24
21 changed files with 1267 additions and 148 deletions

View file

@ -270,6 +270,24 @@ function pxl8.tilemap_check_collision(tilemap, x, y, w, h)
return C.pxl8_tilemap_check_collision(tilemap, x, y, w, h)
end
local tile_data = setmetatable({}, {__mode = "k"})
function pxl8.tilemap_get_tile_data(tilemap, tile_id)
if not tilemap or tile_id == 0 then return nil end
if not tile_data[tilemap] then return nil end
return tile_data[tilemap][tile_id]
end
function pxl8.tilemap_load_ase(tilemap, filepath, layer)
return C.pxl8_tilemap_load_ase(tilemap, filepath, layer or 0)
end
function pxl8.tilemap_set_tile_data(tilemap, tile_id, data)
if not tilemap or tile_id == 0 then return end
if not tile_data[tilemap] then tile_data[tilemap] = {} end
tile_data[tilemap][tile_id] = data
end
pxl8.TILE_FLIP_X = 1
pxl8.TILE_FLIP_Y = 2
pxl8.TILE_SOLID = 4