Wikia

WoWWiki

Changes: API Region GetHeight

Edit

Back to page

m (catfix, Replaced: {{widgetmethod}}<br> → {{widgetmethod}})
(Example)
 
Line 11: Line 11:
 
== Example ==
 
== Example ==
 
myAddonOptionsParent = myAddonOptions:GetParent();
 
myAddonOptionsParent = myAddonOptions:GetParent();
myAddonOptions:SetWidth('''myAddonOptionsParent:GetWidth()''' / 2);
+
myAddonOptions:SetHeight('''myAddonOptionsParent:GetHeight()''' / 2);
   
 
=== Result ===
 
=== Result ===
: The frame named "myAddonOptions" would be set to half the width of its parent frame.
+
: The frame named "myAddonOptions" would be set to half the height of its parent frame.
   
 
== Notes ==
 
== Notes ==

Latest revision as of 04:03, June 10, 2010

Widget API


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

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

Returns Edit

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 Edit

myAddonOptionsParent = myAddonOptions:GetParent();
myAddonOptions:SetHeight(myAddonOptionsParent:GetHeight() / 2);

Result Edit

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

Notes Edit

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

Around Wikia's network

Random Wiki