Code: Select all
myproject/
|- main.lua
|- conf.lua
|- ...
└lib/
└slab/
├const.lua
├API.lua
├Slab.lua
├...
└init.lua
Code: Select all
local Slab = require 'lib/slab'
function love.load(args)
Slab.DisableDocks({'Left', 'Right', 'Bottom'})
-- love.graphics.setBackgroundColor(0.4, 0.88, 1.0)
Slab.Initialize(args)
end
function love.update(dt)
Slab.Update(dt)
Slab.BeginWindow('MyFirstWindow', {Title = "My First Window", AllowMove = false, ShowMinimize = false})
Slab.Text("Welcome.")
Slab.EndWindow()
end
function love.draw()
Slab.Draw()
end
Code: Select all
Error
lib/slab/init.lua:28: module 'const' not found:
no field package.preload['const']
no 'const' in LOVE game directories.
no file 'const' in LOVE paths.
no file '.\const.lua'
no file 'C:\Program Files\LOVE\lua\const.lua'
no file 'C:\Program Files\LOVE\lua\const\init.lua'
no file 'C:\Program Files (x86)\Lua\5.1\lua\const.luac'
no file '.\const.dll'
no file 'C:\Program Files\LOVE\const.dll'
no file 'C:\Program Files\LOVE\loadall.dll'
Traceback
[love "callbacks.lua"]:228: in function 'handler'
[C]: in function 'require'
lib/slab/init.lua:28: in main chunk
[C]: in function 'require'
main.lua:1: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
[C]: in function 'xpcall'
How can I use 'require' properly in this case?