forked from Apancore.Studio/simple-makes-complex
TileSheet: canvases should now be in the sheets subdirectory
This commit is contained in:
@@ -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))
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
Reference in New Issue
Block a user