Understanding getResolution v1.20

X-maul

AKA: Demtrod
Reaction score
201
I am working on this projekt with Kyuft, and we need a hero selection system, and I thought of something like this:
heroselectionconcept.png

(something close to this)
I came across the resolution problem (Not same resolution of every computer), which lead me to this system. Now my problem is, I do not have any idea on how to use it, I seem to be the only person alive who does not know how to make the player calibrate. Also I dont understand how to initiate the system.

Could anyone try to explain this to me?
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
First of all, you have to import the library. Download the library from the thread and go into your map and into the trigger editor. Go to Data>Library>Import Library. Select the library you downloaded and press okay(You can view all the libraries in your map by pressing ctrl+shift+L).

Now in this library there's two actions that you can use. There's the "Player Resolution, UI Resolution, Scale Value". This action takes a player and calibrates the screen for that player. If you call it with "Debug: True" it will give you a lot of extra information on the screen. Let's say you call that trigger for player 1. Player 1's mouse will disappear and he'll get a message telling him to click to calibrate the screen. When he clicks, the mouse appears again.

His screen resolution will be saved in the variables getResolution_UIResolution[1][0] for width and getResolution_UIResolution[1][1] for height. The first index is just the index of the player, so player 5's resolution would be saved in getResolution_UIResolution[5][0] and getResolution_UIResolution[5][1].

There's also an action called "Check Resolution". If you run Check Resolution for a player it'll check if that player has changed resolution since the last time you calibrated. If he has, it'll recalibrate.

Now to use this, you will use the getResolution_UIResolution variable. If you want to make a dialog that always takes up 50% of your screen no matter what resolution you're on, make the dialog width getResolution_UIResolution[player][0]*0.5 and height getResolution_UIResolution[player][1]*0.5.

The problem with this is that you can't resize for each player so either you have to use a different dialog for each player or you have to make it look good for one player.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top