Thread Tools Display Modes
03/15/14, 06:45 PM   #1
s1ckn3ss
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5
Question Anchors

Is there a list of anchors somewhere? I saw an anchor like ZO_Skills there must be more. Can I extract this anchor points somehow?
  Reply With Quote
03/15/14, 09:44 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
frame:SetAnchor(pointOnFrame, relativeToThisOtherFrameOrObject, pointOnThatFrame, offsetXLeftToRight, offsetYTopToBottom)

That second arg can be whatever frame/object/control you need it to be for anchoring. If you want to anchor your addon's frame to the top left of the screen in general, use GuiRoot.

frame:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, 5, 5)
  Reply With Quote
03/15/14, 11:49 PM   #3
Lodur
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 108
Using the zgoo addon and looking at the 'zz UI' section... That is all the extant UI controls you can anchor off of... as far as I know.
  Reply With Quote
03/16/14, 12:01 AM   #4
Errc
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 30
Originally Posted by Lodur View Post
Using the zgoo addon and looking at the 'zz UI' section... That is all the extant UI controls you can anchor off of... as far as I know.
If there is something on your screen you want to anchor on, it is likely easier to '/zgoo mouse' and use :GetParent() and :GetChildren from whatever is picked up to find exactly what you need.
  Reply With Quote
03/16/14, 12:19 PM   #5
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
Originally Posted by Lodur View Post
Using the zgoo addon and looking at the 'zz UI' section... That is all the extant UI controls you can anchor off of... as far as I know.
You can anchor your frame to whatever you want. (So long as it's not circular. - your control anchored to another control which is anchored to your control.....) It doesn't have to be in any sort of list.
  Reply With Quote
03/16/14, 12:44 PM   #6
Halja
 
Halja's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 111
If you are just shifting your main frame/window, I would recommend the overloaded API command. It is SetSimpleAnchor. Then you only have to worry about the parent window and the screen coordinates.

SetSimpleAnchor protected-attributes (object anchorTargetControl, number offsetX, number offsetY)

i.e. frame:SetSimpleAnchor(GuiRoot, 5, 5)

--halja
  Reply With Quote
03/16/14, 01:16 PM   #7
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
Unless the devs have plans for that function in the future, I wouldn't bet 100% on it staying around for forever. The default UI does not use that function at all, and only uses SetSimpleAnchorParent once.
  Reply With Quote
03/18/14, 04:39 PM   #8
inDef
Join Date: Mar 2014
Posts: 16
Has the default UI been posted anywhere yet?

I'd like to know what all the ZO_ functions as well as other default functions do.
  Reply With Quote
03/18/14, 05:04 PM   #9
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
As has been said before, you guys will most certainly know if and when we get permission to post the UI source code.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Anchors


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