Navigation menu

WoW:UI coordinates: Difference between revisions

Jump to navigation Jump to search
{{uitech}}, formatting...
mNo edit summary
 
({{uitech}}, formatting...)
Line 1: Line 1:
{{tocright}}
{{uitech}}{{tocright}}
 
 
The WoW User Interface engine is designed to provide a consistent UI look regardless of screen shape or resolution, and thus scaling is a pervasive part of the WoW User Interface. While this is generally transparent to users of the game, it can cause some confusion for developers, since different sets of functions operate with different scaled coordinate systems. This document tries to provide consistent naming and a description of each one.
The WoW User Interface engine is designed to provide a consistent UI look regardless of screen shape or resolution, and thus scaling is a pervasive part of the WoW User Interface. While this is generally transparent to users of the game, it can cause some confusion for developers, since different sets of functions operate with different scaled coordinate systems. This document tries to provide consistent naming and a description of each one.


= Origin and Axes =
= Origin and Axes =
The origin is generally the BOTTOM LEFT corner of the screen. X coordinates always increase to the RIGHT (and decrease LEFT), and Y coordinates always increase UP (and decrease DOWN).
The origin is generally the BOTTOM LEFT corner of the screen. X coordinates always increase to the RIGHT (and decrease LEFT), and Y coordinates always increase UP (and decrease DOWN).


= Coordinate Systems =
= Coordinate Systems =
Line 25: Line 29:


Currently, for frames with explicit sizes (not anchor defined), [[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.
Currently, for frames with explicit sizes (not anchor defined), [[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.


= Useful Code Snippets =
= Useful Code Snippets =
Line 47: Line 52:
       and ((frameB:GetBottom()*sB) < (frameA:GetTop()*sA));
       and ((frameB:GetBottom()*sB) < (frameA:GetTop()*sA));
  end
  end
[[Category:UI Technical Details]]
Anonymous user