Getting screen resolution

Status
Not open for further replies.
Level 11
Joined
Aug 1, 2009
Messages
963
Okay, so I was thinking about making a custom UI that would span all the way from the bottom left corner to the bottom right. However, this is problematic because all UI objects (ie dialogs) are measured in pixels and different monitors have different resolutions.

I can't seem to find a function that can return the width/height of a player's screen in pixels, which means that right now I have to resort to a player manually entering their screen resolution, which is a rather annoying workaround. Not to mention the fact that if say, someone doesn't know their screen resolution they are kinda screwed over.

Has anyone found a way to work around this?

Thanks.
 
Level 9
Joined
Nov 28, 2008
Messages
704
Tried moving dialogs and boss bars to the edge of the screen in an effort to see if they would snap back and allow me to use those offsets to find it, but they don't.

Silly Blizzard.

Idea: Use banks, make them enter their resolution once and that's all they will ever need to do again.

Another idea: Get the field of view of the default camera, scale it up, and guess based on a list of common resolutions. Edit: This does not work.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,284
If you have so much UI, you will be giving lower resolution computers a serious disadvantage so you should reconsider your design.

I am supprized blizzard did things in pixels, as WC3 used screens, which is infact the actual way programmers position stuff.

Well, there are many solution, to resolution, with the best being a common bank called resolution which all maps axcess to get a players resolution. If a resolution is not present it asks the user for one. The user has 2 ways of choosing a resolution, one via an entry dialog of some form and the other via choosing from a list of standard resolutions commonly used. All maps which feature resolution UI support need to have an easy way of changing the resolution choosen ingame incase a mistake was made.

Additionally there should be a fail safe default of 1024*812 or whatever which is about the smallest a modern player will ever play SC2 at for anyone with no idea.

Everyone however should know their screen resolution, as they are not children as children can not play starcraft II by law (probably will be a 12+). As such you can expect everyone to have a vague idea on their screen resolution (thus a list of common resolutions incase they forget the exact numbers).

I still think blizzard should use the WC3 standard of "screens" as far as interface positioning instead of pixels as it allows a far better resolution scalibility (area covered by interface remains the same).

Basically a screen is a number between 0.0 and 1.0 representing a position on the display buffer independant of the resolution of the buffer. As such the resolution of the buffer can be ignored as it will not influence its position realitvly.
 
Level 13
Joined
Feb 28, 2007
Messages
477
If you have so much UI, you will be giving lower resolution computers a serious disadvantage so you should reconsider your design.
Agreed. But the UI will look ugly in many screen resolutions if that is the case. My map's UI looks best in my own screen's resolution, for obvious reasons. At higher resolutions it's pretty good. At lower resolutions and standard aspect ratios, it's usable but completely fugly.

children can not play starcraft II by law (probably will be a 12+).
Law in which country? The United States has no such law. It's not like ESRB has the power of litigation.


Also, an easier way... Either:
1. Have various UI layouts and the player selects the one he wants.
2. Have the player pick his common resolution by being given graphical representations of each resolution, in the form of brackets on the screen. If none fit, the player can push arrow buttons until it fits snugly on the corners of his monitor. It's pretty much foolproof.
 
Level 11
Joined
Aug 1, 2009
Messages
963
Well, there are only 7 possible screen resolutions available for SC2 anyways, so I think that just having them select from a list would work fine. Potentially just have a preview feature, ie when you mouse over one it automatically applys it before you click so that you can find the one that best fits your monitor.
If you have so much UI, you will be giving lower resolution computers a serious disadvantage so you should reconsider your design.
Why so? If need be, I would just add in low quality resources for computers with lower resolution to prevent it from looking terrible, and potentially adjust the exact width/height ratio for certain aspects of the UI for certain aspect ratios.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,284
tagg1080, you fail to realise that widescreens are not an upgrade. This is why your maps will probably fail unless you start to take this sort of thing into consideration.

A lot of people have better than 1080p screens that are not wide. Wide is purly a ratio, not anything to do with how high resolution a screen is. Someone could be using a 4000*3000 pixel screen, and clearly that is not wide but is way higher resolution than 1080p.

In the end it is probably best to try and avoid excess UI (make sure what is shown is really needed to be shown) to keep as much of the screen free for viewing the map as possible.

Resolution support should not hinder or aid certain resolutions. Someone playing on a 1080p display should have the same shown and same area covered as someone using a 1680*1050 display. Otherwise your map will probably end up seriously unpopular if it is ever discovered.
 
Level 10
Joined
Nov 28, 2008
Messages
655
tagg1080, you fail to realise that widescreens are not an upgrade.


I am not saying it is an upgrade, per say, I am saying that at least everyone I know has a widescreen, as it is getting harder to find any monitor/laptop/TV that ISN'T widescreen.

Maybe it is just where I live, but if I go to the store the ONLY thing sold are widescreen everything.


And the only UI I am using is about 400x150 at the bottom center of the screen, so yes, I am taking this into consideration, :thumbs_up:
 
Level 11
Joined
Aug 1, 2009
Messages
963
If you haven't noticed, Starcraft 2 itself happens to use a UI that stretches from one end of the screen to another. Along with a multitude of other games, a good number of which somehow manage to exist and not totally suck.

Additionally, thats the point of resolution support - so that one resolution is not specifically preferred over others in terms of looks because that one happened to be the resolution the creator used.
 
Level 11
Joined
Aug 1, 2009
Messages
963
Actually, I just realized something.

There is a function that returns where the mouse is clicked, in pixels, on the screen. So basically I could just have the player calibrate his screen in the very beginning by clicking in the topright corner or whichever corner that is opposite the origin corner, and then using math to figure everything else out. This would be simpler than having to enter it, imo.
 
Level 9
Joined
Nov 28, 2008
Messages
704
Hide the game UI and bottom right should get it.

You will be one pixel off though :(

On my 1920 * 1080 screen, I could only click 1919 * 1079. Although that is perfect, since there is a (0, 0) thing. Doesnt matter though :D
 
Level 13
Joined
Apr 15, 2008
Messages
1,063
You could make a really small button for some welcome screen and then detect when the player clicks it and when he clicks in general, somehow match those two, so you will get the general area in which the button is. (If the button is small enough, it will be precise to determine one of the seven resolutions) That won't require players to calibrate anything, thus elegantly solving the problem.
(The idea of using different coordinates for mouse and dialogs is so idiotic... I tried to make custom minimap, detect clicks, so player can move camera around using this minimap... and it failed totally, since the "resolution" for dialog placement is like 1600x1200)
 
How're you going to get around the problem of using commands/abilities with a fully custom UI?

Edit: You know the UI console made by Blizzard uses a model, right? That's why it has moving parts and other animations... In the model viewer thing you can find it under UI/Console/Terran/ConsoleTerran. If you find out how to blank out its textures or otherwise modify it; tell me.
 
Last edited:
Level 4
Joined
May 13, 2010
Messages
66
How're you going to get around the problem of using commands/abilities with a fully custom UI?

Edit: You know the UI console made by Blizzard uses a model, right? That's why it has moving parts and other animations... In the model viewer thing you can find it under UI/Console/Terran/ConsoleTerran. If you find out how to blank out its textures or otherwise modify it; tell me.

Can't you just edit it with 3ds max? Or blender once that supports m3 exporting.
 
Can't you just edit it with 3ds max? Or blender once that supports m3 exporting.

Maybe, if I could just learn some basic modeling and what not. I'm very busy with scripting, philosophy, computer & information science, etc. right now though and I'm not even sure how I'd replace the model, Blizzard has put so many things off limits to us... I wouldn't be surprised if they made it extra hard to replace those models.
 
Status
Not open for further replies.
Top