Get a list of supported screen resolutions with NW.js?

Get help using Construct 2

Post » Thu Nov 17, 2016 3:52 am

I'm not sure if it's possible, but I'd like to allow the user to select screen resolutions from a list of resolutions supported on their hardware configuration. I know how to make a listbox and change the resolution, I just need to know how to get a list of supported (fullscreen) resolutions.
Spriter Dev
B
99
S
21
G
12
Posts: 3,259
Reputation: 16,894

Post » Thu Nov 17, 2016 9:13 am

I'm not sure a list of supported resolutions is relevant since full screen just scales up the game to cover the entire screen. Aka it doesn't change the actual display resolution, at least I don't think it does.

Here's the api provided by nwjs which you probably can access from the browser object.
http://docs.nwjs.io/en/latest/
I didn't notice anything to get a list of resolutions there.

If you really want a list of supported resolutions you could make a nwjs addon that calls winapi functions to get that info. I think there was a construct classic example that used some Python to do that, although the actual c code to do it should be pretty easy to find online.
B
92
S
32
G
110
Posts: 5,295
Reputation: 71,501

Post » Thu Nov 17, 2016 11:25 am

With modern displays, there is only one truly supported resolution, which is the physical resolution, which is probably the resolution it is already running at. The "list of supported resolutions" mainly existed for old CRT monitors which could genuinely display other resolutions. These days if you actually change resolution you'll get the same thing as low quality fullscreen mode: just stretching to fill the screen.
Scirra Founder
B
398
S
236
G
88
Posts: 24,433
Reputation: 194,635

Post » Thu Nov 17, 2016 12:09 pm

Thank you both for the info. That makes things pretty simple.
Spriter Dev
B
99
S
21
G
12
Posts: 3,259
Reputation: 16,894


Return to How do I....?

Who is online

Users browsing this forum: Apollo14 and 25 guests