require "string" local img_bank = {} function load_textures_from(path) path = path or "assets/images" local files = lf.getDirectoryItems(path) for _, file in ipairs(files) do local filepath = path.."/"..file if lf.getInfo(filepath).type == "directory" then load_textures_from(filepath) else if string.find(filepath, ".png") then local name = string.gsub(filepath, ".png", "") name = string.gsub(name, "assets/images/", "") img_bank[name] = love.graphics.newImage(filepath) end end end end function get_tex(name) return img_bank[name] end