Thread Tools Display Modes
08-13-11, 01:22 AM   #1
barbol12
A Cyclonian
 
barbol12's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2010
Posts: 42
frame sizing + pos for multi res

hello guys, apparently i am having trouble with sizing frames for multiple resolutions...

here is how it is setup....
lua Code:
  1. getscreenheight = tonumber(string.match(({GetScreenResolutions()})[GetCurrentResolution()], "%d+x(%d+)"))
  2. function UIScale()
  3.     if C["General"].autoscaleUI == true then
  4.         C["General"].uiscale = min(1, max(.64, 768/getscreenheight))
  5.     end
  6. end
  7. UIScale()
  8.  
  9. local mult = 768/string.match(GetCVar("gxResolution"), "%d+x(%d+)")/C["General"].uiscale
  10.  
  11. local function scale(x)
  12.     return mult*math.floor(x/mult+.5)
  13. end
  14. function Scale(x) return scale(x) end
  15. E.mult = mult
  16.  
  17.  
  18. function CreatePanel2(f, w, h, a1, p, a2, x, y)
  19.     local sh = Scale(h)
  20.     local sw = Scale(w)
  21.     local sx = Scale(x)
  22.     local sy = Scale(y)
  23.     f:SetFrameLevel(1)
  24.     f:SetHeight(sh)
  25.     f:SetWidth(sw)
  26.     f:SetFrameStrata("BACKGROUND")
  27.     f:SetPoint(a1, p, a2, sx, sy)
  28.     f:SetBackdrop(mainback)
  29.     f:SetBackdropColor(unpack(C["Colors"].Bg))
  30.     if C["General"].classborders then
  31.     f:SetBackdropBorderColor(unpack(C["Colors"].Classes))
  32.     else
  33.     f:SetBackdropBorderColor(unpack(C["Colors"].Border))
  34.     end
  35. end
  36.  
  37. raid = CreateFrame("Frame", "raidframe", UIParent)
  38.     CreatePanel2(raid, 359, 147, "RIGHT", UIParent, "RIGHT", -5, -347)

but the sizing isnt the same size/proportion as the resolution its made on.. anyone know what exactly is wrong or what i can do a little different to fix the problem..

note: i make it on a 1440 x 900... and have the scaling+positioning problems with the larger resolutions

Last edited by barbol12 : 08-13-11 at 01:33 AM.
  Reply With Quote
08-13-11, 05:23 AM   #2
suicidalkatt
A Rage Talon Dragon Guard
 
suicidalkatt's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 331
A couple of screenshots would definitely help.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » frame sizing + pos for multi res


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off