WoW:API Region GetHeight: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
m (Updated format)
m (Move page script moved page API Region GetHeight to API Region GetHeight without leaving a redirect)
 
(6 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<center>'''GetHeight''' ''-Documentation by [[AeroBrain]]-''</center>
{{widgetmethod}}
Gets the height and width, respectively, of an object.


Gets the height of a frame-based object.
dimension = MyObject:GetWidth();
dimension = MyObject:GetHeight();


height = <i>FrameLayout</i>:GetHeight();
== Parameters ==


----
=== Arguments ===
;''Arguments''


:<i>none</i>
=== 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 [[API Region SetHeight|:SetHeight]]() / [[API Region SetHeight|:SetWidth]](), or the actual height/width used if computed from two or more [[API Region SetPoint|:SetPoint]]() calls.


----
== Example ==
;''Returns''
myAddonOptionsParent = myAddonOptions:GetParent();
myAddonOptions:SetHeight('''myAddonOptionsParent:GetHeight()''' / 2);


: height
=== Result ===
:; height : Number - The height of the frame-based object.
: The frame named "myAddonOptions" would be set to half the height of its parent frame.
 
----
;''Example''
myAddonOptionsParent = myAddonOptions:GetParent();
myAddonOptions:SetHeight(''myAddonOptionsParent:GetHeight()'' / 2);


;''Result''
== Notes ==
: The frame named 'myAddonOptions' would be set to half the height of its parent frame.


----
Note that even though [[UIOBJECT FontString|FontString]] has GetWidth()/GetHeight() methods, they behave very differently and have potentially very little to do with the displayed dimension.
{{Template:WoW API}}
[[Category:API Frame Functions|FrameLayout GetHeight]]

Latest revision as of 04:47, 15 August 2023

Widget API ← Region < GetHeight

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

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

Parameters[edit]

Arguments[edit]

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.