For A game I'm making, I am forcing it to be lower resolution than the max resolution(for high resolution systems), so the max resolution is 1920x1080p. My laptop runs at 3200x1800, so in conf.lua I changed the settings for fullscreen = true, width = 1920, height = 1080. So this should make the screen 1920 x 1080 right? love.graphics.getWidth and love.graphics.getHeight report back 1920 by 1080, but while putting my mouse in the lower right corner of the screen and then printing the position of the mouse, I get 1279x720. Which is near 720p compared to the 1080p I want. I know my laptop can go to almost 4k resolution, so 1080 is easy for it.
Am I doing something wrong?
Get Screen size is incorrect?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Get Screen size is incorrect?
Ah, I found the reason, I have the scaling(Size of text and other elements) level on my PC to be 150%. So Love2d apparently uses that when it draws the screen. So the screen maybe 1920x1080, but with scaling a 150% 1280x720 are all that would show on the screen.
Would there be a way to check the true screen resolution that shows on the screen? Or get the amount of scale that is used? Or even change the scaling to 100% just while the game runs.
Would there be a way to check the true screen resolution that shows on the screen? Or get the amount of scale that is used? Or even change the scaling to 100% just while the game runs.
- slime
- Solid Snayke
- Posts: 3170
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Get Screen size is incorrect?
LÖVE uses the SDL library for cross-platform windowing-related functionality, and unfortunately SDL doesn't have high-dpi / dpi scaling awareness support for Windows right now.
SDL also has a related bug with fullscreen dimensions in Windows when DPI scaling is different than 100%, which I think you're encountering. Maybe you could try fullscreen-desktop mode instead of 'exclusive' fullscreen?
SDL also has a related bug with fullscreen dimensions in Windows when DPI scaling is different than 100%, which I think you're encountering. Maybe you could try fullscreen-desktop mode instead of 'exclusive' fullscreen?
Re: Get Screen size is incorrect?
Fullscreen Desktop mode still uses window's scaling. The only change is I can't set the screen resolution, it is constantly 2133 by 1200. On the bright side though, love.graphics.getWidth and getHeight both work correctly.
I guess I could probably get away with love.graphics.scale(), was hoping for the easy way though.
I guess I could probably get away with love.graphics.scale(), was hoping for the easy way though.
- slime
- Solid Snayke
- Posts: 3170
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Get Screen size is incorrect?
Yeah, fullscreen-desktop mode will always use the same dimensions as the desktop.
Who is online
Users browsing this forum: No registered users and 4 guests