Two love windows (game and controls)

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
deb75
Prole
Posts: 38
Joined: Sun Apr 18, 2021 1:11 pm

Two love windows (game and controls)

Post 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
User avatar
ReFreezed
Party member
Posts: 612
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

Re: Two love windows (game and controls)

Post 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?
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
deb75
Prole
Posts: 38
Joined: Sun Apr 18, 2021 1:11 pm

Re: Two love windows (game and controls)

Post 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.
User avatar
zorg
Party member
Posts: 3449
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Two love windows (game and controls)

Post 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 3427 times
Use whatever you want to implement it, be it two canvases, or just simple transformations to treat the window as 2 separate areas.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests