This library obtains the player's resolution, UI resolution, and scale value with a mouseclick.
Changelog
New from v1.10
Works better on battle.net (No longer have to ask the player to hold while clicking)
Screen flips due to the validation trigger removed
Able to check if the player's resolution has changed with the use of a dialog
Incorrect numbers clicking while moving the mouse fixed
New from v1.00
Will now work with ANY resolution
Retrieves the player's UI screen size (Essential for creating dialogs)
Now works in Windowed Mode
Nearly half the size of v1.00 (5.30KB compressed)
Ability to check resolution to ensure its validity
Able to initiate the system for individual players
No longer required to enter Camera bounds
How to use
There are two functions that can be used:
Player Resolution, UI Resolution, Scale Value
Use this function to initiate the system and obtain the selected player's resolution information.
Check Resolution
Use this function to check if the player's resolution has changed. It will display an invisible dialog button at the location of their mouse relative to the UI resolution of what it has stored. If the mouse does not enter the dialog then the resolution has been changed. The system will then be reinitialized for that player.
Creating Dialogs/Screen objects
After the system has been initiated for the selected player, the information obtained will be stored in three variables:
getResolution_PlayerResolution[15][1]
getResolution_PlayerUIResolution[15][1]
getResolution_PlayerScaleValue[15]
The first dimension of the arrays are the player's number (0-15). The second dimension of the resolution variables are the Width(0) and Height(1).
When creating dialog or screen objects, you use the PlayerUIResolution variable. You multiply this variable from a range of 0 to 1. 1 being 100%. Here is an example dialog that takes up 25% of the player's screen.
If the player's UI resolution were 1600x1200, then the above example dialog would translate to:
SetsizeofExampleDialogto((1600*.5),(1200*.5))
which is 25%.
With this, you can setup dialogs to be exact sizes and at exact positions on the player's screen.
yeah, very nice, you could also add how to use it, for example we can only change dialogs size with custom script for each player without making a dialog for every player?
The main intention of this library is to find the value being multiplied to all dialog dimensions on a player's screen for scaling. The scaling is to keep a dialog's size consistent from resolution to resolution.
This is very useful information when designing, for example, a custom minimap. If you do not know the minimap's dialog dimensions on a player's screen and want to implement the functionality of being able to pan to a certain place in the world by clicking on the minimap then it would not be possible to achieve. Yes, this was my personal dilemma and thus the creation of the library :).
So, how do you use this library? If you created a dialog of size 512x256 and a player's resolution is set to 1440x900 then the dialog's size for that player would be 384x192 because the value being multiplied to the dialog's dimensions is .75.
...for example we can only change dialogs size with custom script for each player without making a dialog for every player?
If you are asking if we are able to change a dialog's size for each player, then the answer is no. Changing a dialog's size would reflect the change for all of the players. You would have to create a dialog for each player to do what you want (or see my idea below). But, why would you would to do this? It would cause inconsistency in the scaling as it would make the dialog small on one resolution and large on another.
Let's compare with a dialog of absolute size 512x256 on resolutions 1024x768 and 1920x1200.
If however, you still want to do this, then I have a way to achieve it. The only negative about it is that you won't be able to use a dialog background which isn't that bad considering you can just make one with a dialog item (image). The idea summed up is you would have to create the dialog according to the resolution 1280x720 as this has the smallest scale value of all of the resolutions (.6). This would make the dialog perfectly sized for that resolution while larger for the other resolutions, depending on their scale values, but never smaller. After that, you simply add "padding" to the dialog with math when creating or manipulating dialog items. The dialog contents would be aligned and sized with the set dimensions you would provide across all resolutions; they would not be scaled down. Just let me know if you, or anyone else, is interested in this feature and I will implement it.
@desiderius1: Go
I thought I heard it is possible to set the dialogs size/player with custom script.
Without that I would have to make dialog and dialog item for every player, which in my case would took lots of time for me to do and would take lots size from my map. I think I will just wait that blizz make some kind of fix.
@desiderius1: Go
Without that I would have to make dialog and dialog item for every player, which in my case would took lots of time for me to do and would take lots size from my map. I think I will just wait that blizz make some kind of fix.
It's hard to help when I do not know what you are trying to accomplish. If you want you can send me a PM regarding the details. But, have you looked at what I posted above and my idea? With that you would only have to create the dialog in question once as well as all of it's contents only once. You would not have to create a dialog/dialog contents for every player.
hmm I not really understand what you mean under padding, But anyway I figured out a way for myself, I could simple make 1 dialog for the biggest resolution, than hide its background. Than down scale and reposition all players dialog items according their resolution in it. (I dont know however that you if you can click through hidden dialog background?) And if you still want dialog background just make a image dialog item or separate dialog for everyone behind the current one.
I am remaking my dialogs for this map: http://www.sc2mapster.com/maps/warring-factions/ and the new dialogs will be set into the info UI...
I am still not sure if I will use up your stuff or just wait for blizz to make something.
I know that, but that means I have to make every dialog item for every player.
Also I have to scale dialog items size and position according to that.
I will just wait for blizz to make it optional to dialogs can be scaled according to resolution. I dont think it would be so hard to make it for them and would really help out.
Dont use dialog backgrounds and if you really want to use dialog background than make it with sc2layout.
(Dialog item size and position can be set / player)
However in this case you wont be able to add dialogs offset if you want it to work properly.
To clarify, this DOES still require the user to know their own resolution and choose it and hit continue? If so we may have a problem... In windowed mode you can drag the window to be any size you want... I know I've had ones around 1400 by w/e resolutions from my fraps videos.
Edit: While the window does constrain you to a max widescreen of 16:9 (I think), it might not be as intuitive for people who do not know their resolution.
Yes, in windowed mode it does require the player to select their resolution from a list whereas in fullscreen and windowed(fullscreen) they do not but only have to to click their mouse.
I am working on an update that will grab the player's resolution as soon as the system is initiated. No mouse clicks required (fullscreen). I'm also working on getting the system to work for windowed mode players so they do not have to pick from a list but may have to click their mouse.
That would be awesome... cause I think in the broad spectrum most users don't remember nor perhaps even understand why they have to do it. In essence, their confusion is similar to ours: Why don't we have a way to figure it out easily lol.
It doesnt seems to work with windowed mode, (it says please click again, and happens nothing, even if I use the getresolution map )
edit:
this doesnt seems right, when I was using on my map:
Variable - Set Player-Example_DialogWidth[(Picked player)] = ((Real(Example_DialogWidth)) * getResolution_PlayerUIScaleValue[(Picked player)])
this doesnt seems right, when I was using on my map: Variable - Set Player-Example_DialogWidth[(Picked player)] = ((Real(Example_DialogWidth)) * getResolution_PlayerUIScaleValue[(Picked player)])
I was just showing how dialogs are scaled down depending on the resolution set and demonstrated it in trigger form. If you want to set a dialog to be a specific size on a specific resolution, then the way you are doing it is correct.
getResolution v1.20
About
This library obtains the player's resolution, UI resolution, and scale value with a mouseclick.
Changelog
New from v1.10
New from v1.00
How to use
There are two functions that can be used:
Use this function to initiate the system and obtain the selected player's resolution information.
Use this function to check if the player's resolution has changed. It will display an invisible dialog button at the location of their mouse relative to the UI resolution of what it has stored. If the mouse does not enter the dialog then the resolution has been changed. The system will then be reinitialized for that player.
Creating Dialogs/Screen objects
After the system has been initiated for the selected player, the information obtained will be stored in three variables:
The first dimension of the arrays are the player's number (0-15). The second dimension of the resolution variables are the Width(0) and Height(1).
When creating dialog or screen objects, you use the PlayerUIResolution variable. You multiply this variable from a range of 0 to 1. 1 being 100%. Here is an example dialog that takes up 25% of the player's screen.
If the player's UI resolution were 1600x1200, then the above example dialog would translate to:
which is 25%.
With this, you can setup dialogs to be exact sizes and at exact positions on the player's screen.
Debug
Here is with debugging enabled:
Download
Library
http://www.sc2mapster.com/media/files/543/832/getResolutionv120_GUI.SC2Lib
Map
http://www.sc2mapster.com/media/files/543/831/getResolution_v1.20_GUI.SC2Map
Very nice library, will definitely use this in my map (and give credit of course).
yeah, very nice, you could also add how to use it, for example we can only change dialogs size with custom script for each player without making a dialog for every player?
@Hookah604: Go
The main intention of this library is to find the value being multiplied to all dialog dimensions on a player's screen for scaling. The scaling is to keep a dialog's size consistent from resolution to resolution.
This is very useful information when designing, for example, a custom minimap. If you do not know the minimap's dialog dimensions on a player's screen and want to implement the functionality of being able to pan to a certain place in the world by clicking on the minimap then it would not be possible to achieve. Yes, this was my personal dilemma and thus the creation of the library :).
So, how do you use this library? If you created a dialog of size 512x256 and a player's resolution is set to 1440x900 then the dialog's size for that player would be 384x192 because the value being multiplied to the dialog's dimensions is .75.
The math in trigger form:
If you are asking if we are able to change a dialog's size for each player, then the answer is no. Changing a dialog's size would reflect the change for all of the players. You would have to create a dialog for each player to do what you want (or see my idea below). But, why would you would to do this? It would cause inconsistency in the scaling as it would make the dialog small on one resolution and large on another.
Let's compare with a dialog of absolute size 512x256 on resolutions 1024x768 and 1920x1200.
Quite a difference.
If however, you still want to do this, then I have a way to achieve it. The only negative about it is that you won't be able to use a dialog background which isn't that bad considering you can just make one with a dialog item (image). The idea summed up is you would have to create the dialog according to the resolution 1280x720 as this has the smallest scale value of all of the resolutions (.6). This would make the dialog perfectly sized for that resolution while larger for the other resolutions, depending on their scale values, but never smaller. After that, you simply add "padding" to the dialog with math when creating or manipulating dialog items. The dialog contents would be aligned and sized with the set dimensions you would provide across all resolutions; they would not be scaled down. Just let me know if you, or anyone else, is interested in this feature and I will implement it.
Hope that helps.
@desiderius1: Go I thought I heard it is possible to set the dialogs size/player with custom script.
Without that I would have to make dialog and dialog item for every player, which in my case would took lots of time for me to do and would take lots size from my map. I think I will just wait that blizz make some kind of fix.
Here is the function and its parameters in galaxy.
There is no parameter to specify a particular playergroup or player when setting a dialog size.
It's hard to help when I do not know what you are trying to accomplish. If you want you can send me a PM regarding the details. But, have you looked at what I posted above and my idea? With that you would only have to create the dialog in question once as well as all of it's contents only once. You would not have to create a dialog/dialog contents for every player.
Hmmm. Excellent excellent. I very much like this.
@desiderius1: Go
hmm I not really understand what you mean under padding, But anyway I figured out a way for myself, I could simple make 1 dialog for the biggest resolution, than hide its background. Than down scale and reposition all players dialog items according their resolution in it. (I dont know however that you if you can click through hidden dialog background?) And if you still want dialog background just make a image dialog item or separate dialog for everyone behind the current one.
I am remaking my dialogs for this map: http://www.sc2mapster.com/maps/warring-factions/ and the new dialogs will be set into the info UI...
I am still not sure if I will use up your stuff or just wait for blizz to make something.
@Hookah604: Go
save the scaling factor as a variable
Then, make your dialog a loop, For each player should work
Then, set up the dialogs by using a size, or offset, multiplied by the scaling factor
Store the dialogs using player number(or loop number) in the loop
@Usernameisntworkingright: Go
I know that, but that means I have to make every dialog item for every player. Also I have to scale dialog items size and position according to that. I will just wait for blizz to make it optional to dialogs can be scaled according to resolution. I dont think it would be so hard to make it for them and would really help out.
Ohhh I made workaround!
Dont use dialog backgrounds and if you really want to use dialog background than make it with sc2layout. (Dialog item size and position can be set / player)
However in this case you wont be able to add dialogs offset if you want it to work properly.
hmm I get syntax error when I add the library and try to save it.
To clarify, this DOES still require the user to know their own resolution and choose it and hit continue? If so we may have a problem... In windowed mode you can drag the window to be any size you want... I know I've had ones around 1400 by w/e resolutions from my fraps videos.
Edit: While the window does constrain you to a max widescreen of 16:9 (I think), it might not be as intuitive for people who do not know their resolution.
@OneTwoSC: Go
Yes, in windowed mode it does require the player to select their resolution from a list whereas in fullscreen and windowed(fullscreen) they do not but only have to to click their mouse.
I am working on an update that will grab the player's resolution as soon as the system is initiated. No mouse clicks required (fullscreen). I'm also working on getting the system to work for windowed mode players so they do not have to pick from a list but may have to click their mouse.
@desiderius1: Go
That would be awesome... cause I think in the broad spectrum most users don't remember nor perhaps even understand why they have to do it. In essence, their confusion is similar to ours: Why don't we have a way to figure it out easily lol.
@desiderius1: Go thx
Hmm, I wonder how will you make it that it detects resolution.
It doesnt seems to work with windowed mode, (it says please click again, and happens nothing, even if I use the getresolution map )
edit:
this doesnt seems right, when I was using on my map: Variable - Set Player-Example_DialogWidth[(Picked player)] = ((Real(Example_DialogWidth)) * getResolution_PlayerUIScaleValue[(Picked player)])
isnt it: Variable - Set Player-Example_DialogWidth[(Picked player)] = (((Real(Example_DialogWidth)) * (1 / getResolution_PlayerUIScaleValue[(Picked player)])) ?
Click again, a list should appear with either standard or widescreen resolutions.
I was just showing how dialogs are scaled down depending on the resolution set and demonstrated it in trigger form. If you want to set a dialog to be a specific size on a specific resolution, then the way you are doing it is correct.
well, it doesnt.
edit, well it not always seems to work.