Page 1 of 1

Resolution Question

Posted: Wed Jan 30, 2013 4:45 pm
by Luska72
When I coded my game, I had a ScreenScaleWidth and ScreenScaleHeight variable, which was created with "CurrentScreenSize/800." My intent was to be able to easily scale all graphics with the new screen size.
However the love.graphics.ToggleFullscreen() functions AUTO scales for me, I don't need thosevariables at all.

The thing is, I am eventually going to put images into the game. I was hoping someone could tell me if images also auto-scale with ToggleFullscreen and SetSize(x,y,fullscreen,vsync). I don't want to have to go back and re-code anything later down the road, so if anyone wants to explain when I do and don't need the "scale" variables, I would be very grateful.

Re: Resolution Question

Posted: Wed Jan 30, 2013 4:48 pm
by bartbes
toggleFullscreen doesn't scale, it's just changing your monitor resolution to 800x600.

Re: Resolution Question

Posted: Wed Jan 30, 2013 5:23 pm
by Luska72
What exactly does that mean, I just looked it up but I don't quite understand the difference. If it makes my moniter resolution 800x600, does that look any different than actually scaling? Also, if i do "scale" that would imply i have different images for 32x32 and 64x64 and 128x128 correct?

edit: "have images" changed to: "have different images"

Re: Resolution Question

Posted: Wed Jan 30, 2013 7:03 pm
by mickeyjm
When your screen resolution is changed the computer streches everything to fit the screen, which is like scaling but doesnt maintain and aspect ratios so things can look warped, and as you are decreasing the screen size images will lose there quality as one pixel takes up more actual pixels

Re: Resolution Question

Posted: Wed Jan 30, 2013 10:04 pm
by Robin
bartbes wrote:toggleFullscreen doesn't scale
Yes, obviously you should be using Node.js instead.

(Sorry.)

Re: Resolution Question

Posted: Sat Feb 16, 2013 8:41 pm
by Taehl
I made the TLfres library to deal with this problem. It'll automagically scale everything to fit any resolution / aspect ratio you want.

Re: Resolution Question

Posted: Sat Feb 16, 2013 9:00 pm
by scutheotaku
Luska72 wrote:What exactly does that mean, I just looked it up but I don't quite understand the difference. If it makes my moniter resolution 800x600, does that look any different than actually scaling? Also, if i do "scale" that would imply i have different images for 32x32 and 64x64 and 128x128 correct?

edit: "have images" changed to: "have different images"
You can think of it this way:
  • Scaling an image is changing how many pixels equal 1 original pixel. For example, if you have a 1 pixel x 1 pixel block, and then you scale it 4x, then it will be 4 pixels x 4 pixels - so 4 pixels for every one pixel.*
  • Changing the resolution changes the real-life size of a pixel on your screen. For example, at one resolution a pixel may be 1mm x 1mm, at another resolution it may be 5mm by 5mm. That's why things like menus and desktop icons will seem smaller at lower screen resolutions.
*scaling is hardly this straightforward though...for example, there's often some blending or even some pixels lost when scaling - it all depends on what scaling algorithm you use.

Re: Resolution Question

Posted: Sun Feb 17, 2013 4:20 am
by Inny
You can use love.graphics.getModes to know which fullscreen modes the video hardware actually supports. If you want to give the player the option of picking one, you can iterate that list for all of the modes you want to support, and use something like TLfres to letterbox the modes that don't quite fit.

Re: Resolution Question

Posted: Wed Feb 20, 2013 1:13 pm
by Hexenhammer
I am not sure doing your own (software) scaling is necessarily the best thing in this day and age. I certainly won't do it. If you have a decent graphic card (e.g. anything half-way modern by Nvidia) the GPU itself can scale the output using the desired method. This is fast and looks great in my experience. I use Nvidia's GPU aspect-ratio scaling when playing old games all the time and I am impressed with the results.

Relying on the graphic card here allows the user to choose what kind of scaling he wants (if any) and your game won't run any slower because of it. Of course if you desperately want to support systems which don't have decent graphic hardware and/or players who have never looked at what their graphic card can do, you might still want to do you own software scaling.. but only then.