Resolution Question

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
Luska72
Prole
Posts: 18
Joined: Thu Jan 03, 2013 6:14 pm

Resolution Question

Post 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.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Resolution Question

Post by bartbes »

toggleFullscreen doesn't scale, it's just changing your monitor resolution to 800x600.
Luska72
Prole
Posts: 18
Joined: Thu Jan 03, 2013 6:14 pm

Re: Resolution Question

Post 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"
User avatar
mickeyjm
Party member
Posts: 237
Joined: Thu Dec 29, 2011 11:41 am

Re: Resolution Question

Post 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
Your screen is very zoomed in...
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Resolution Question

Post by Robin »

bartbes wrote:toggleFullscreen doesn't scale
Yes, obviously you should be using Node.js instead.

(Sorry.)
Help us help you: attach a .love.
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: Resolution Question

Post 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.
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+.
scutheotaku
Party member
Posts: 235
Joined: Sat Dec 15, 2012 6:54 am

Re: Resolution Question

Post 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.
User avatar
Inny
Party member
Posts: 652
Joined: Fri Jan 30, 2009 3:41 am
Location: New York

Re: Resolution Question

Post 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.
User avatar
Hexenhammer
Party member
Posts: 175
Joined: Sun Feb 17, 2013 8:19 am

Re: Resolution Question

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 57 guests