silent mode of love2d window

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
findux
Prole
Posts: 6
Joined: Wed Jul 29, 2020 6:46 pm

silent mode of love2d window

Post 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.
User avatar
GVovkiv
Party member
Posts: 668
Joined: Fri Jan 15, 2021 7:29 am

Re: silent mode of love2d window

Post 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
User avatar
pgimeno
Party member
Posts: 3541
Joined: Sun Oct 18, 2015 2:58 pm

Re: silent mode of love2d window

Post 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
Attachments
test.love
(784 Bytes) Downloaded 84 times
findux
Prole
Posts: 6
Joined: Wed Jul 29, 2020 6:46 pm

Re: silent mode of love2d window

Post by findux »

Thank you so much pgimeno and CVovkiv. it was exactly what i was looking for.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 18 guests