Page 1 of 1
Can I make a window always appear on top?
Posted: Fri Aug 21, 2015 2:35 am
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!
Re: Can I make a window always appear on top?
Posted: Fri Aug 21, 2015 2:48 am
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.
Re: Can I make a window always appear on top?
Posted: Fri Aug 21, 2015 5:23 am
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.
Re: Can I make a window always appear on top?
Posted: Fri Aug 21, 2015 7:43 am
by Alexar
use ffi lib to solve it. for example using api user32. getForeground setTop etc...but in other platform i dont know.
Re: Can I make a window always appear on top?
Posted: Fri Aug 21, 2015 5:28 pm
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.
Re: Can I make a window always appear on top?
Posted: Sat Aug 22, 2015 5:04 pm
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...
Re: Can I make a window always appear on top?
Posted: Sun Aug 23, 2015 9:57 am
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.
Re: Can I make a window always appear on top?
Posted: Sun Aug 23, 2015 6:08 pm
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?
Re: Can I make a window always appear on top?
Posted: Mon Aug 24, 2015 8:59 am
by Robin
I'd look into wxLua, I think it does all the things you want to do.