Thank you all for your suggestions!
I don't see the advantage of using LibUtilites-1.0 since I can achieve the same with a small snippet and without modifying all elements of my UI.
I've found this is the solution I prefer:
Lua Code:
local f = CreateFrame("Frame", nil, UIParent)
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:SetScript("OnEvent", function(self, event)
SetCVar("uiScale", "1")
SetCVar("useUiScale", "1")
local newScale = 768 / string.match(({GetScreenResolutions()})[GetCurrentResolution()], "%d+x(%d+)")
UIParent:SetScale(newScale) -- change the size and reload your ui (/reloadui) or restart the game
f:UnregisterAllEvents()
end)
I will make it a one time loading thing though and give the player the option to redo it or just use his own scaling.
Thanks for all the fast and helpful answers.