test.lua
Lua
local module = {}
module.myString = "Hello from test.lua!"
function module.sayHello()
return "hello world"
end
return module
main.lua
Lua
local testModule = require "test"
function love.load()
-- txt = parser.read_file("init.txt")
end
function love.draw()
love.graphics.print(testModule.myString,200,200)
love.graphics.print(testModule.sayHello(),200,500)
效果