TileSheet: canvases should now be in the sheets subdirectory

This commit is contained in:
Van
2025-11-20 15:53:41 +03:00
parent c1948be3d7
commit 5206945b62
3 changed files with 2 additions and 2 deletions

View File

@@ -62,8 +62,8 @@ end
---@return TileSheet ---@return TileSheet
function TileSheet:new(image, tileWidth, tileHeight) function TileSheet:new(image, tileWidth, tileHeight)
local modPath = core.get_modpath(core.get_current_modname()) local modPath = core.get_modpath(core.get_current_modname())
-- The canvas image must be in `<mod_name>/textures`, otherwise it will not be retrieved. -- The canvas image must be in `<mod_name>/textures/sheets/`, otherwise it will not be retrieved.
local width, height = getSizePng(modPath .. '/textures/' .. image) local width, height = getSizePng(modPath .. '/textures/sheets/' .. image)
if width % tileWidth ~= 0 or height % tileHeight ~= 0 then if width % tileWidth ~= 0 or height % tileHeight ~= 0 then
error('Tilesheet does not have an integer number of tiles with resolution ' .. tostring(tileWidth) ..' * '.. tostring(tileHeight)) error('Tilesheet does not have an integer number of tiles with resolution ' .. tostring(tileWidth) ..' * '.. tostring(tileHeight))

View File

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

View File

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB