Can I make a window always appear on top?

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
Isogash
Prole
Posts: 3
Joined: Fri Aug 21, 2015 2:30 am

Can I make a window always appear on top?

Post by Isogash »

I couldn't find it in the API, and I couldn't find it with a google search anywhere. I'm looking to start a project in love2d for a number of great reasons, but an always-on-top mode is a pretty essential feature. I guess I can live without it for now but is there any workaround to this? Will I have to add it the framework source code myself eventually?

Thanks for your help!
User avatar
slime
Solid Snayke
Posts: 3162
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Can I make a window always appear on top?

Post by slime »

There isn't a way to do this in love currently - SDL2 (which love uses as a cross-platform backend for window-related functionality) doesn't have that feature in its APIs either.
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: Can I make a window always appear on top?

Post by T-Bone »

This is also something I wouldn't expect from a game. It could get kind of annoying. What are you trying to accomplish? There might be a better solution.
User avatar
Alexar
Party member
Posts: 174
Joined: Thu Feb 05, 2015 1:57 am
Location: Chengdu,China

Re: Can I make a window always appear on top?

Post by Alexar »

use ffi lib to solve it. for example using api user32. getForeground setTop etc...but in other platform i dont know.
Isogash
Prole
Posts: 3
Joined: Fri Aug 21, 2015 2:30 am

Re: Can I make a window always appear on top?

Post by Isogash »

T-Bone wrote:This is also something I wouldn't expect from a game. It could get kind of annoying. What are you trying to accomplish? There might be a better solution.
The game's working title is Numpad RPG. It's essentially a JRPG combat styled super customizable time-killer. The idea is that it can run borderless in the corner of your screen and it only accepts input from the numpad. It can also be hidden/minimised with a button press if you want to turn your full attention to what you're doing. As a game, it is fully turn based, so you can just mash keys in the correct order to play and suddenly stopping will have no impact.

It's to JRPGs what rogue is to traditional RPGs, something you'd play when you're waiting for e.g. a compiler.

Anyway, it would be nice to provide an option for "always on top" so that you can continue to use the rest of your computer like normal whilst you are playing. I was even planning to either move the game or hide it when you mouse over it, so that you can access that corner. Other features would include the option for Num Lock to enable/disable the game input, for those that actually use the numpad.
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Can I make a window always appear on top?

Post by zorg »

Isogash wrote:
T-Bone wrote:This is also something I wouldn't expect from a game. It could get kind of annoying. What are you trying to accomplish? There might be a better solution.
The game's working title is Numpad RPG. It's essentially a JRPG combat styled super customizable time-killer. The idea is that it can run borderless in the corner of your screen and it only accepts input from the numpad. It can also be hidden/minimised with a button press if you want to turn your full attention to what you're doing. As a game, it is fully turn based, so you can just mash keys in the correct order to play and suddenly stopping will have no impact.

It's to JRPGs what rogue is to traditional RPGs, something you'd play when you're waiting for e.g. a compiler.

Anyway, it would be nice to provide an option for "always on top" so that you can continue to use the rest of your computer like normal whilst you are playing. I was even planning to either move the game or hide it when you mouse over it, so that you can access that corner. Other features would include the option for Num Lock to enable/disable the game input, for those that actually use the numpad.
On the other hand, that would actually need some kind of os-wide keyboard hook to work as well, from what i understand; löve doesn't give you that functionality either...
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.
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: Can I make a window always appear on top?

Post by T-Bone »

It also doesn't sound like a game that takes advantage of Löve's graphics and audio capabilites. Why not use a "normal" application engine rather than a game engine? I think you're more likely to find the functionality you need there.
Isogash
Prole
Posts: 3
Joined: Fri Aug 21, 2015 2:30 am

Re: Can I make a window always appear on top?

Post by Isogash »

T-Bone wrote:It also doesn't sound like a game that takes advantage of Löve's graphics and audio capabilites. Why not use a "normal" application engine rather than a game engine? I think you're more likely to find the functionality you need there.
I want to use Lua as much as possible to allow user extension and customization of the game (modding). The fact that love2d is completely built on Lua lets me do this a million times easier, also allowing for Lua defined asset loading, which means I can allow user sprites and sounds. I could write the whole thing from scratch but the development time would be monstrous. Right now I just want to work on this in spare time.

Does anyone know if it would be possible to add the necessary OS-hooks in future, or will I eventually have to write an engine from scratch?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Can I make a window always appear on top?

Post by Robin »

I'd look into wxLua, I think it does all the things you want to do.
Help us help you: attach a .love.
Post Reply

Who is online

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