Originally Posted by myrroddin
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.
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.