p2r3 / spplice

Simple Portal 2 Package Loading Instrument for Convenient External modding
GNU General Public License v3.0
17 stars 2 forks source link

DPI based resolution on Windows, gitignore and typo #1

Closed PancakeTAS closed 2 years ago

PancakeTAS commented 2 years ago

Added a small piece of code that scaled the resolution of the window with the dpi (on windows, this is the scale percentage) and resolution of the screen for the main monitor. Haven't found a way to do this once it moves onto another monitor.

Needs testing on linux I guess.

Another note, fetching the screen resolution with window.getSize() returns null for some reason, so the size needs to be entered in the code instead of read from the config. I'd keep minWidth and minHeight always the same.

gitignore is also kept very simple just to prevent pushing the wrong files in the future

p2r3 commented 2 years ago

fetching the screen resolution with window.getSize() returns null for some reason

I assume you meant window resolution. I don't see why this would happen, but I guess for the meanwhile, maybe app.getConfig() can be used to at least get the window size from the neutralino.config.json file.

I'm also changing the PR title to mention that it's platform-specific, as to not defer anyone from continuing work on this issue for Linux or Mac.

p2r3 commented 2 years ago

Just for the record, in case someone comes back to this - the reason this doesn't work for Linux is because multiple monitors often seem to be treated as one display by Neutralino. This makes it treat two side-by-side 1080p monitors as one 3840x1080 display.