Page 1 of 1

How to add window settings in main.lua file?

Posted: Wed Dec 13, 2023 6:19 pm
by sxnvmqe
I have created a config file while I watched tutorials and I want to move this to main.lua file. Show to do that? I know it belongs to function .love.load() but I don't know how to get it work.

function love.conf(app)
app.window.title = "simpleGame"
app.window.icon = "img/icon.png"
app.window.width = 320
app.window.height = 160
app.window.display = 4
end

Re: How to add window settings in main.lua file?

Posted: Wed Dec 13, 2023 8:42 pm
by zorg
Why do you want to move it into main.lua? Just leave it in conf.lua... also, it does not "belong to function love.load()" whatever that means.

If you want to defer creation of the window, you still need a conf.lua file where you do... in your case, app.window = false,
then in love.load, you can create the window yourself with whatever size you need, but you need to call more functions instead of just setting table values. love.window.setMode for starters.