View Single Post
Unread 04-26-10, 03:24 PM   #21
TravisWatson
A Deviate Faerie Dragon
Join Date: Apr 2010
Posts: 11
Originally Posted by Sideshow View Post
You say SetCVar / GetCVar ??? I corrected it to GetCVar / GetCVar
You are incorrect by changing this code to use 2 GetCVars, since there are two arguments in nightcracker's code, and GetCVar only has one argument:

http://wowprogramming.com/docs/api/GetCVar

I also don't agree with nightcracker's original code either (and this may be simply a misunderstanding on my part as well). It seems like the multiplier calculation should only call GetCVar:

Code:
local mult = (768/string.match(({GetScreenResolutions()})[GetCurrentResolution()], "%d+x(%d+)"))/GetCVar("uiScale")
His original code, if I understand it correctly, would override your UIScale Cvar permanently with a fixed value.

Anyways, the premise to this method is finding the reverse multiplier that WoW is using, so it is scaling you one way, and you're scaling it back before you draw, thereby negating effects of both the UI scaling and the "in-game" resolution based off a 768 pixel height screen.

I'm still going to reiterate this warning: using this method will cause the code ignore UI scaling. Use only where appropriate.

For instance, a 1 pixel border ignoring UI scale is fine, as it will stretch to encompass the entire container and still serve its purpose while retaining is pixel perfection. Using it to scale an entire frame will result in the UI enlarged or contracted in comparison to your addon because your addon isn't scaling with everything else.

Last edited by TravisWatson : 04-26-10 at 03:28 PM.
TravisWatson is offline   Reply With Quote