I want my game to work on multiple resolutions.
Is it possible to create a menu where user can chose his resolution and toogle fullscreen/windowed mode in-game?
I know that such stuff is stored in the config file, but is it possible to somehow modify it after the game is compiled?
Changing display resolution in-game?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Changing display resolution in-game?
- The game is not actually compiled.
- You can use setMode (http://love2d.org/docs/love_graphics_setMode_1.html):
Code: Select all
love.graphics.setMode(width, height, fullscreen, true, 0)
Help us help you: attach a .love.
Re: Changing display resolution in-game?
Thanks a lot, that was the thing I was looking for
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Changing display resolution in-game?
I beg to differ, you might want to learn the inner workings of lua?Robin wrote:The game is not actually compiled.
Anyway, the code is compiled at runtime, so in theory you should be able to modify the config, however LÖVE doesn't offer a way to change things in the .love. You should probably just write to the game.conf (it will then be written to the save dir, which will take precedence over the game.conf in the .love) Another way is to stop LÖVE from creating a window and do it manually after reading the settings from a save file, the first one is probably easier.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Changing display resolution in-game?
Sure, Lua is compiled at run-time, but .loves are not.
Help us help you: attach a .love.
Who is online
Users browsing this forum: Amazon [Bot] and 18 guests