Jump to content
Toggle menu
  • 17.3K articles
  • 8.2K files
  • 5 users
  • 280.7K edits
WoW Classic Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

API Region GetHeight

From WoW Classic Wiki
(Redirected from API Region GetWidth)

Gets the height and width, respectively, of an object.

dimension = MyObject:GetWidth();
dimension = MyObject:GetHeight();

Returns

dimension
Number - height/width of the object in pixels, in its own coordinate space (scaling dependent). This is the desired height/width, if set with :SetHeight() / :SetWidth(), or the actual height/width used if computed from two or more :SetPoint() calls.

Example

myAddonOptionsParent = myAddonOptions:GetParent();
myAddonOptions:SetWidth(myAddonOptionsParent:GetWidth() / 2);

Result

The frame named "myAddonOptions" would be set to half the width of its parent frame.

Notes

Note that even though FontString has GetWidth()/GetHeight() methods, they behave very differently and have potentially very little to do with the displayed dimension.