View Single Post
08-02-16, 03:56 AM   #7
gempir
A Black Drake
 
gempir's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2015
Posts: 84
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:
  1. local f = CreateFrame("Frame", nil, UIParent)
  2. f:RegisterEvent("PLAYER_ENTERING_WORLD")
  3. f:SetScript("OnEvent", function(self, event)
  4.     SetCVar("uiScale", "1")
  5.     SetCVar("useUiScale", "1")
  6.     local newScale = 768 / string.match(({GetScreenResolutions()})[GetCurrentResolution()], "%d+x(%d+)")
  7.     UIParent:SetScale(newScale) -- change the size and reload your ui (/reloadui) or restart the game
  8.     f:UnregisterAllEvents()
  9. 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.
  Reply With Quote