Quantcast WoWInterface - View Single Post - Pixel Perfection for Specific Resolution
View Single Post
04-11-10, 11:38 AM   #7
A Molten Giant
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
UI Scale is one way, but when I'm making an addon, I can't set the users UI scale to my value. So I have to make a workaround. If I scale any value with the following function, there comes out the value needed to represent the amount of "virtual pixels" needed by the frame to get the amount of "real pixels".

local mult = SetCVar("uiScale", 768/string.match(({GetScreenResolutions()})[GetCurrentResolution()], "%d+x(%d+)"))/GetCVar("uiScale")
local function scale(x) return mult*x end

I implemented this method in TukUI and ncUI to get them both pixelperfect.
Three things are certain,
Death, taxes and site not found,
You, victim of one.
  Reply With Quote