Home

Awesome

explanation and methods

functionparamreturn
addimage: Image, tag: string (optional)
genAtlas
getRecttag: stringx: int, y: int, w: int, h: int
getQuadtag: stringquad: Quad
serializeserial: string
saveAtlaspath: stringerror: error
saveSerialpath: stringerror: error

code example

local packer = require "packer"

function love.load()
	local files = love.filesystem.getDirectoryItems("test_images/")

	for _, file in ipairs(files) do
		local fileName = "test_images/" .. file

		packer:add(love.graphics.newImage(fileName), fileName)
	end

	packer:genAtlas()
	packer:saveAtlas("atlas.png")
	packer:saveSerial("serial.lua")
end

function love.draw()
	love.graphics.draw(packer.atlas, 0, 0)
end

credits