Thread Tools Display Modes
03-08-11, 07:12 AM   #1
Fhorau
A Kobold Labourer
Join Date: Mar 2011
Posts: 1
Stuf Unit Frames Anchoring

I made an UI compilation and I want it to work with all resolutions. Everything is anchored to "BOTTOM" and placed in the lower half of the screen, so the aspect ratio doesn't matter. Just Stuf is still anchoring the default way and doesn't fit with diverse ratios. It has no in-game anchor settings.
How can I change it? Do I need to rewrite anything in the LUA code? If so, what?
  Reply With Quote
03-11-11, 04:18 AM   #2
gfxamk
A Murloc Raider
 
gfxamk's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2009
Posts: 7
look at the core.lua of the stuf addon.do a search for
Code:
uf:SetPoint
and you should find
Code:
uf:SetPoint("TOPLEFT", UIParent, "TOPLEFT", dbuf.x, dbuf.y)
change that to something like
Code:
uf:SetPoint("TOPLEFT", UIParent, "BOTTOM", dbuf.x, dbuf.y)
or better make an anchorframe perhaps 1x1 pixel and then move the unitframes with your anchor.
Code:
uf:SetPoint("CENTER", YourAnchorFrameName, "CENTER", dbuf.x, dbuf.y)
perhaps you need to adjust the x/y postioning, depends on how you do it
  Reply With Quote
03-17-11, 01:09 PM   #3
Lordyfrb
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 71
Originally Posted by gfxamk View Post
look at the core.lua of the stuf addon.do a search for
Code:
uf:SetPoint
and you should find
Code:
uf:SetPoint("TOPLEFT", UIParent, "TOPLEFT", dbuf.x, dbuf.y)
change that to something like
Code:
uf:SetPoint("TOPLEFT", UIParent, "BOTTOM", dbuf.x, dbuf.y)
or it
Theres a slight problem with your coding, altoough it looks like it would work, the way Stuf positions its frames, you would only be able to move the frames to the right and down from the bottom center of your screen.

The way I accomplished this was to edit 2 files, the first been the same file mentioned in your post (Stuf\core.lua) , but to change the line to read:
Code:
uf:SetPoint("BOTTOM", UIParent, "BOTTOM", dbuf.x, dbuf.y)
Then you need to change Stuf's options file which is Stuf_Options\options.lua

Find line 1192 or do a search for
Code:
x.max, y.min
and replace that line with the following
Code:
x.max, y.min = floor(sw / s)/2, 0
x.min, y.max = -floor(sw / s)/2, floor(sh /s)
Both these changes will have the effect of anchoring all the unit frames to the bottom center of the screen, so on a fresh install some frames will appear on top of each other.
__________________
  Reply With Quote
04-08-11, 06:47 AM   #4
Nhuwaen
A Defias Bandit
AddOn Compiler - Click to view compilations
Join Date: Apr 2011
Posts: 3
Is there any way to anchor every unit frame individually? For example I need to anchor everything to bottom, except for party unit frames, I need to anchor them to topleft.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Stuf Unit Frames Anchoring


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