I'll star off by saying I'm a complete idiot so bear with me.
Is it possible with love to make a game where the resolution is scalable? For example all the demos that I see are always at a fixed resolution (you can go full screen but of course it just stretches it) i've never seen one where the game/demo has a resolution option.
as far as i can learn all I can do is give a position relative to the origin point 0,0 and do whatever i want there for lets a button and then put in the button pressed events. so if I had a window at 500x500 if I set something out 250 pixels it would be half way. but if I made the windows 1920x1080 it would be way off from being in the middle. so all I can think of right now to do is make the window the same aspect ratio i want but keep the res small so it will on a varyed type of monitors without just running off the screen if the monitor is too small in resolution. ie make the window 640x360 so it will fit on a pos monitor thats 640x480 as well as being scable up 960x540, 1024x576, 1280,720, 1366x768, 1600x900 etc etc. because the game would be much more beautiful that way on many different types of monitors rather than forcing some 1995 era resolution.
so im not sure how to progess. if you guys could point me in the right direction id be very grateful
Resolution
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Resolution
I have used the camera from http://nova-fusion.com/2011/05/09/camer ... nt-bounds/ as I found it simple and easy to use at the same time. If you don't need a complete camera, the code you can use is:
This will scale everything drawn by scaleX and scaleY, so the positions to be calculed are the same no matter the size. Combined with love.graphics.setMode you should be able to make some resolutions. Hope it helps!
Code: Select all
function love.draw()
love.graphics.push()
love.graphics.scale(scaleX, scaleY)
-- draw stuff here
love.graphics.pop()
end
- Taehl
- Dreaming in associative arrays
- Posts: 1025
- Joined: Mon Jan 11, 2010 5:07 am
- Location: CA, USA
- Contact:
Re: Resolution
I made the TLfres library just for this.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Re: Resolution
even better, thanksTaehl wrote:I made the TLfres library just for this.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 7 guests