-- json read sample. -- -- Use json.lua -- rxi/json.lua: A lightweight JSON library for Lua -- https://github.com/rxi/json.lua function love.load() json = require 'json' text = love.filesystem.read('data.json') o = json.decode(text) cur_time = 0 end function love.update(dt) cur_time = cur_time + dt end function love.draw() y = 8 love.graphics.print("ESC to exit.", 8, y) y = y + 32 for key, value in pairs(o) do local fn = value["path"] love.graphics.print(key .. " : " .. fn, 8, y) y = y + 24 end end function love.keypressed(key, isrepeat) if key == "escape" then love.event.quit() end end