Links |
---|
Sets the desired width and height of a Region, relative to its own effective scaling.
Region:SetWidth(width) Region:SetHeight(height) Region:SetSize(width, height)
Arguments
- width
- Number - The desired height of a frame, taking into account its scaling
- height
- Number - The desired width ofa frame, taking into account its scaling
Example
myAddonOptionsParent = myAddonOptions:GetParent(); myAddonOptions:SetHeight(myAddonOptionsParent:GetHeight() / 2);
- Result
- The frame named 'myAddonOptions' would be set to half the height of its parent frame.
Notes
- These functions are subordinate and complimentary to Region:SetPoint(...) that is used to define one or more anchor points for a region
- If the left and right edges of the region are defined by anchor points, then setting width in this manner has no effect
- If the bottom and top edges of the region are defined by anchor points, then setting height in this manner has no effect
- If insufficient points have been set to define the region's shape, then setting width and/or height in this manner can complete the region
- The actual dimentions normally depends on the region's effective scale, which is the product of its own scale and that of its parents (if any)
Patch changes
Patch 4.0.1 (2010-10-12): SetSize() first appears in FrameXML.[1][2]
Patch 1.11.0 (2006-06-19): Consolidated to Region.[3]
Patch 1.10.0 (2006-03-28): All Frames, Textures and FontStrings now have SetWidth() and SetHeight()[4]
See also
- Region:GetWidth - Returns the computed width, which may be same as what was set or may result from two or more anchor points
- Region:GetHeight - Returns the computed height, which may be same as what was set or may result from two or more anchor points
- Region:GetSize - Returns the computed width and height, as shorthand for GetWidth() and GetHeight()
References
- ^ 2010-10-19, ActionBarFrame.xml, version 4.0.1.13164, near line 116, archived at Townlong-Yak
- ^ 2010-10-19, CompactUnitFrame.lua, version 4.0.1.13164, near line 460, archived at Townlong-Yak
- ^
slouken 2006-05-12. Re: Upcoming 1.11 Changes - Concise List. Archived from the original
- ^
slouken 2006-01-27. Re: Upcoming 1.10 Changes - Concise List. Archived from the original