getResolution

getResolution

2.6k Downloads

getResolution v1.20

About

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.

InitializationGrammar

  • 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.

Check Resolution Grammar

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.

Example Dialog Setup

If the player's UI resolution were 1600x1200, then the above example dialog would translate to:

Set size of ExampleDialog to ((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. Example Dialogs in-game

Debug

Here is with debugging enabled:

Debug

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