im trying to make some kind of window that doesnt close no matter what you do unless you hold a certain button.
is there some kind of love function that makes the window forcefully open by itself or is it just not possible?
love.window.setFullscreen(true)
local t = 0
function love.update(dt)
if not love.window.hasFocus() then
-- ??
end
if love.keyboard.isDown('g') then
t = t + dt
if t > 1 then
love.event.quit()
end
end
end
function love.keyreleased(key)
if key == 'g' then
t = 0
end
end
It's not possible to make a window that doesn't close "no matter what you do". You could probably make it harder than usual with some ffi trickery. But it would be system dependent, and frankly. it sounds pretty much like asshole design. Nobody wants a program that behaves like that.
grump wrote: ↑Tue Sep 12, 2017 8:45 am
It's not possible to make a window that doesn't close "no matter what you do". You could probably make it harder than usual with some ffi trickery. But it would be system dependent, and frankly. it sounds pretty much like asshole design. Nobody wants a program that behaves like that.
yes, i agree that it's a bad design if it's a game of some sort. im using it for myself because some of my siblings peak my pc while im off doing something else. i just use love2d for some childish stuff nowadays tbh lol
slime wrote: ↑Tue Sep 12, 2017 12:07 pm
You can use the love.quit callback to prevent the game from quitting when certain conditions are met, and love.event.quit to cause the game to quit.
Using both love.quit and having a borderless window may help; no buttons -> no os-specific exit button.
Me and my stuff True 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.
slickytree wrote: ↑Tue Sep 12, 2017 12:21 pmyes, i agree that it's a bad design if it's a game of some sort. im using it for myself because some of my siblings peak my pc while im off doing something else. i just use love2d for some childish stuff nowadays tbh lol
It might be enough to prank a bunch of kids. But you said "no matter what you do", and there's no easy way you can prevent someone from opening the task manager or a console and just kill your process. There's also simply Alt-Tab, I don't know if that can be intercepted from a love app.
They only fool-proof "no matter what you do" thing is the lock screen feature of your OS. Or maybe you could install your love app as a password protected screensaver.