WoW:API Region SetPoint: Difference between revisions

m
Move page script moved page API Region SetPoint to WoW:API Region SetPoint without leaving a redirect
(→‎Details: details on edges)
m (Move page script moved page API Region SetPoint to WoW:API Region SetPoint without leaving a redirect)
 
(3 intermediate revisions by 3 users not shown)
Line 8: Line 8:
== Arguments ==
== Arguments ==
; point : String - Point of the object to adjust based on the anchor.
; point : String - Point of the object to adjust based on the anchor.
; relativeFrame : String/Widget - Name of, or reference to, a frame to attach obj to; defaults to the object's parent (or the screen, if object has no parent) if nil or omitted.
; relativeFrame : String/Widget - Name or reference to a frame to attach obj to. If omitted or nil, it typically defaults to the object's parent. However, if relativePoint is also not defined, relativeFrame will default to UIParent.
; relativePoint : String - point of the relativeFrame to attach point of obj to. If not specified, defaults to the value of point.
; relativePoint : String - point of the relativeFrame to attach point of obj to. If not specified, defaults to the value of point.
; ofsx : Number - x-offset (negative values will move ''obj'' left, positive values will move ''obj'' right), defaults to 0 if not specified.
; ofsx : Number - x-offset (negative values will move ''obj'' left, positive values will move ''obj'' right), defaults to 0 if not specified.
Line 14: Line 14:


=== Points ===
=== Points ===
There are eight valid point values:
There are nine valid point values:
* "TOP", "RIGHT" "BOTTOM" "LEFT": the center-points of the respective sides.
* "TOP", "RIGHT" "BOTTOM" "LEFT": the center-points of the respective sides.
* "TOPRIGHT", "TOPLEFT", "BOTTOMLEFT", "BOTTOMRIGHT": corners of the frame rectangle.
* "TOPRIGHT", "TOPLEFT", "BOTTOMLEFT", "BOTTOMRIGHT": corners of the frame rectangle.
* "CENTER": the center point of the frame rectangle.


== Examples ==
== Examples ==
Line 32: Line 33:
* Behavior of this function with multiple anchors is complex. Generally, you can override points by setting them again (so repeated assignment to the "TOPLEFT" point of a frame would move the frame, unless other anchor points interfere). If you're repositioning a frame, call <code>obj:[[API Region ClearAllPoints|ClearAllPoints]]()</code> to eliminate unwanted interactions.
* Behavior of this function with multiple anchors is complex. Generally, you can override points by setting them again (so repeated assignment to the "TOPLEFT" point of a frame would move the frame, unless other anchor points interfere). If you're repositioning a frame, call <code>obj:[[API Region ClearAllPoints|ClearAllPoints]]()</code> to eliminate unwanted interactions.
* Offset units are relative to the screen's effective scale. WoW's screen always has a height of 768 units, while screen width varies with aspect ratio.
* Offset units are relative to the screen's effective scale. WoW's screen always has a height of 768 units, while screen width varies with aspect ratio.
* <tt>ofsx</tt> and <tt>ofsy</tt> must both be passed as arguments for either to take effect; they default to 0 only when neither is given.  That is, <tt>foo:SetPoint(bar, 40)</tt> will ignore the 40 rather than treat it as (+40,+0).
* Secure frames will silently ignore calls to this function if the relative frame is a [[API FontString|FontString]].


=== Edge definitions ===
=== Edge definitions ===
Anonymous user