How can I make the window full-screen for my game? Plus I don't want to change the resolution just make it full-screen mode ( just cover the rest of the screen with black, not a window ) and not in just an over-sized window if possible.
My resolution is 800x600 for my game, my PC supports 1366x768. (O_o)
How do I get Full-Screen?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: How do I get Full-Screen?
Change:
to:
in the conf.lua.
Read more: https://love2d.org/wiki/Config_Files
Code: Select all
t.screen.fullscreen = false
Code: Select all
t.screen.fullscreen = true
Read more: https://love2d.org/wiki/Config_Files
"Docendo discimus" - Lucius Annaeus Seneca
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: How do I get Full-Screen?
Also, if you supply 0 as width and height, it'll use whatever the monitor can handle (so 1366x768 in your case). Note that if you do this, you must check what the width and height are inside your game (with love.graphics.getWidth andlove.graphics.getHeight) to make sure everything fits on the screen.
Help us help you: attach a .love.
Re: How do I get Full-Screen?
I want to use F to go to fullscreen mode and W to go to window mode.
I tried this code inside the conf script. The game does not start.
Is their a way I can control the fullscreen mode in the conf script?
I tried this code inside the conf script. The game does not start.
Code: Select all
if key == 'f' then
-- fullscreen mode
t.screen.fullscreen = true
end
if key == 'w'
-- window mode
t.screen.fullscreen = false
end
Re: How do I get Full-Screen?
Forget coding in the conf.lua!
There are only configuration settings.
For your problem, insert the following code in the main.lua or expand your love.keypressed-function.
See:
https://love2d.org/wiki/love.keypressed
https://love2d.org/wiki/love.graphics.toggleFullscreen
These sites help to understand. But for you as a beginner, reading some tutorials and the wiki would be better.
There are only configuration settings.
For your problem, insert the following code in the main.lua or expand your love.keypressed-function.
Code: Select all
function love.keypressed(key, unicode)
if key == "f" then love.graphics.toggleFullscreen() end
end
https://love2d.org/wiki/love.keypressed
https://love2d.org/wiki/love.graphics.toggleFullscreen
These sites help to understand. But for you as a beginner, reading some tutorials and the wiki would be better.
"Docendo discimus" - Lucius Annaeus Seneca
Re: How do I get Full-Screen?
wow, one line of code! I was way off...
Thanks, this works perfect (^_^)
Thanks, this works perfect (^_^)
Who is online
Users browsing this forum: Google [Bot] and 81 guests