-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lua
41 lines (26 loc) · 877 Bytes
/
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
-- main.lua
package.path = package.path .. ";lib/?/init.lua;lib/?.lua;src/?.lua"
local argparse = require "argparse"
local Generator = require "generator"
local generator
function love.load(arg)
local parser = argparse("love .", "Generate a complete tileset from a compressed one")
parser:argument("input", "Input image file. Example input_tileset.png")
parser:argument("output", "Output image file. Example output_tileset.png")
local args = parser:parse(arg)
assert(love.filesystem.getInfo(args.input), "File " .. args.input .. " does not exist!")
generator = Generator({
input_file_name = args.input,
output_file_name = args.output
})
end
function love.update(dt)
if generator:is_drawed() then
generator:save_file()
love.event.quit()
end
end
function love.draw()
generator:draw()
end