Quantcast
WoWInterface - View Single Post - Pixel Perfect UIScale
View Single Post
02-28-20, 04:06 PM   #6
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 1,934
Originally Posted by myrroddin View Post
You need to check if GetPhysicalScreenSize()'s second return is >= 1200; if it is, modify SDPhantom's method to scale UIParent.
Code:
local physicalWidth, physicalHeight = GetPhysicalScreenSize()
local pixelPerfectScale = 768 / physicalHeight
if screenHeight >= 1200 then
    UIParent:SetScale(pixelPerfectScale)
else
    SetCVar("useUiScale", 1)
    SetCVar("uiScale", pixelPerfectScale)
end
screenHeight is undefined in your if condition, do you mean physicalHeight?



Originally Posted by Be3f. View Post
Using your code snippet does not produce the desired result unfortunately similar to this script

Code:
/script SetCVar("uiScale", 768/string.match(({GetScreenResolutions()})[GetCurrentResolution()], "%d+x(%d+)"))
The two are exactly the same in fullscreen, but this script doesn't account for window assets like the title bar or a resized window in windowed mode. Both affect the optimal scale. In some situations, the script doesn't work at all. GetCurrentResolution() keeps returning zero no matter what mode I run in on my laptop and causes the script to throw errors instead.
__________________
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 02-28-20 at 06:22 PM.
  Reply With Quote