Page 1 of 1

Two love windows (game and controls)

Posted: Sat Aug 07, 2021 8:59 pm
by deb75
Hello,

In my game, I want to have one main löve window, for the game itself, and another window dedicated to controls.

That way, controls do not pollute the window game.

Following the discussion about multiple windows here,
it seems not possible that one löve process is able to open more than one window however, it seems possible to make two
löve processes communicate.


Roughly, my plan is that the main löve process spawns another löve process with for example

Code: Select all

os.system("love control args ...")
This has to be asynchroneous of course.

The main löve process starts a server listening on a given port and passes this port to the löve control process through
the previous args. Then, once the löve control process is up, I can use e.g. löve-nuklear or Slab libraries to display some controls
which send messages to the listening main löve process which decides what to do with it.

Did anyone ever tried to do something like this ? If yes, which network library is best fitted ?

Regards

Re: Two love windows (game and controls)

Posted: Sat Aug 07, 2021 9:21 pm
by ReFreezed
Sometimes people make a separate program for development/debugging stuff, i.e. a program that sends commands to the game via sockets, similar to what you're saying. It's very easy to implement simply using LuaSocket.

Out of curiosity, how would having multiple windows decrease "pollution"? Why not just have one window where one part is dedicated to the controls and the other for the game view? Is the game meant to be played using two fullscreen windows on two different displays or something?

Re: Two love windows (game and controls)

Posted: Sat Aug 07, 2021 9:58 pm
by deb75
Hi,

Thanks for your quick answeer,

About pollution, I mean that the controls may hide one part of the game, some controls will have a visual effects like change color, shape of some objects and the changes operated by the controls could be partly or totally hidden by the controls itself.

Re: Two love windows (game and controls)

Posted: Sun Aug 08, 2021 10:06 am
by zorg
deb75 wrote: Sat Aug 07, 2021 9:58 pm Hi,

Thanks for your quick answeer,

About pollution, I mean that the controls may hide one part of the game, some controls will have a visual effects like change color, shape of some objects and the changes operated by the controls could be partly or totally hidden by the controls itself.
You can work around that by just restricting one of these to one part of the window, and the other to the other part. example image attached:
ds.png
ds.png (5.05 KiB) Viewed 3529 times
Use whatever you want to implement it, be it two canvases, or just simple transformations to treat the window as 2 separate areas.