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.
Resolution Question
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Resolution Question
toggleFullscreen doesn't scale, it's just changing your monitor resolution to 800x600.
Re: Resolution Question
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"
edit: "have images" changed to: "have different images"
Re: Resolution Question
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...
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Resolution Question
Yes, obviously you should be using Node.js instead.bartbes wrote:toggleFullscreen doesn't scale
(Sorry.)
Help us help you: attach a .love.
- Taehl
- Dreaming in associative arrays
- Posts: 1025
- Joined: Mon Jan 11, 2010 5:07 am
- Location: CA, USA
- Contact:
Re: Resolution Question
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+.
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
-
- Party member
- Posts: 235
- Joined: Sat Dec 15, 2012 6:54 am
Re: Resolution Question
You can think of it this way: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"
- 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.
Re: Resolution Question
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.
- Hexenhammer
- Party member
- Posts: 175
- Joined: Sun Feb 17, 2013 8:19 am
Re: Resolution Question
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.
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.
Who is online
Users browsing this forum: Bing [Bot] and 2 guests