m
Updated GetWidth/GetHeight details.
({{uitech}}, formatting...) |
m (Updated GetWidth/GetHeight details.) |
||
| Line 19: | Line 19: | ||
The [[API GetCursorPosition|x,y = GetCursorPosition()]] function returns the x,y location in UI Root Coordinates, with the origin in its standard BOTTOM LEFT screen corner location. | The [[API GetCursorPosition|x,y = GetCursorPosition()]] function returns the x,y location in UI Root Coordinates, with the origin in its standard BOTTOM LEFT screen corner location. | ||
(Prior to WoW 2.0, for frames with anchor-defined sizes (not forced sizes), [[API LayoutFrame GetWidth|w = layoutFrame:GetWidth()]] and [[API LayoutFrame GetHeight|h = layoutFrame:GetHeight()]] return values in the UI Root Coordinate system.) | |||
== Frame Scaled Coordinates == | == Frame Scaled Coordinates == | ||
Most frame-specific coordinate functions operate in a coordinate system that is adjusted by the Frame's effective scale (As returned by [[API Frame GetEffectiveScale|effScale = frame:GetEffectiveScale()]]. Each unit in the frame scaled coordinate system corresponds to effScale units in the UI Root coordinate system. The origin, however, is still the BOTTOM LEFT corner of the screen. | Most frame-specific coordinate functions operate in a coordinate system that is adjusted by the Frame's effective scale (As returned by [[API Frame GetEffectiveScale|effScale = frame:GetEffectiveScale()]]. Each unit in the frame scaled coordinate system corresponds to effScale units in the UI Root coordinate system. The origin, however, is still the BOTTOM LEFT corner of the screen. | ||
The main methods which return values in Frame Scaled Coordinates are [[API Frame GetLeft|x = frame:GetLeft()]], [[API Frame GetRight|x = frame:GetRight()]], [[API Frame GetBottom|y = frame:GetBottom()]], [[API Frame GetTop|y = frame:GetTop()]], | The main methods which return values in Frame Scaled Coordinates are [[API Frame GetLeft|x = frame:GetLeft()]], [[API Frame GetRight|x = frame:GetRight()]], [[API Frame GetBottom|y = frame:GetBottom()]], [[API Frame GetTop|y = frame:GetTop()]], [[API Frame GetCenter|x,y = frame:GetCenter()]], and [[API Frame GetRect|l,b,w,h = frame:GetRect()]] | ||
In addition, anchor offsets, as controlled by [[API LayoutFrame SetPoint|layoutFrame:SetPoint("POINT","RelativeFrame","RELPOINT",x,y)]] and the anchoring XML elements, are also specified in the Frame Scaled coordinate system of the point that is being anchored, but are relative to the attachment point on the relative frame. This can sometimes have surprising results if the layoutFrame and RelativeFrame have different effective scales. | In addition, anchor offsets, as controlled by [[API LayoutFrame SetPoint|layoutFrame:SetPoint("POINT","RelativeFrame","RELPOINT",x,y)]] and the anchoring XML elements, are also specified in the Frame Scaled coordinate system of the point that is being anchored, but are relative to the attachment point on the relative frame. This can sometimes have surprising results if the layoutFrame and RelativeFrame have different effective scales. | ||
[[API LayoutFrame GetWidth|w = layoutFrame:GetWidth()]] and [[API LayoutFrame GetHeight|h = layoutFrame:GetHeight()]] return values in the Frame Scaled coordinate system, and the corresponding set functions [[API LayoutFrame SetWidth|layoutFrame:SetWidth(w)]], and [[API LayoutFrame SetWidth|layoutFrame:SetHeight(h)]] take values in the Frame Scaled coordinate system. | |||