Page 1 of 1

silent mode of love2d window

Posted: Mon Jul 26, 2021 10:05 am
by findux
Hi,
I am making cnc machine simulator/post processor with love2d.
The software I made simply takes the existing numeric code and converts it to numeric code that the machine can work more securely. As a user, I may sometimes want to simulate. But most of the time, I want to run it from the command line, without opening the graphical interface, with command line parameters. How can I make it work silently from the command line? Is there any mode of love2d to do this?
Thanks ..
Eyüp.

Re: silent mode of love2d window

Posted: Mon Jul 26, 2021 11:44 am
by GVovkiv
I guess you can in conf.lua disable

Code: Select all

t.modules.window = false
t.console = true -- for windows only, or open it from console/terminal directly
t.modules.graphics = false -- for example, if you run program with -nographics mode or something

Re: silent mode of love2d window

Posted: Mon Jul 26, 2021 11:47 am
by pgimeno
In conf.lua:

Code: Select all

function love.conf(c)
  c.window = nil
end
Also you better disable some modules that you won't be using. Don't disable the event module, and quit with love.event.quit().

If you want to create a window e.g. when given certain parameters in the command line, call love.window.setMode() to start graphic mode.

Example attached. For usage, call with: love test.love

Re: silent mode of love2d window

Posted: Mon Jul 26, 2021 12:28 pm
by findux
Thank you so much pgimeno and CVovkiv. it was exactly what i was looking for.