Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
Advertisement

Regions are abstract rectangular areas of the screen, providing common API inheritted by concrete subtypes such as Frame, Texture or FontString.


Class Hierarchy

API

Region has all the methods from UIObject, plus the following:

Fundamental properties
Region:SetParent(parent or parentName) - Defines this region as a child of parent or _G["parentName"], causing many properties to inherit
Region:SetPoint(...) - Defines an attachment point of this region
Region:SetAllPoints(frame or frameName) - Defines attachment points for this region to match edges of the specified frame
Region:ClearAllPoints() - Removes all previously-defined attachment points for this region
Region:GetNumPoints() - Returns the number of anchor points defined for this frame
Region:GetPoint(index) - Returns the details of the indexth anchor point defined for this frame (point, relativeTo, relativePoint, xofs, yofs)
Defining size and location
Region:SetHeight(height) - Defines the height of the object (scale dependent)
Region:SetWidth(width) - Defines the width of the object (scale dependent)
Region:SetSize(width,height) - Defines the width and the height, as shorthand for SetWidth() and SetHeight()
Region:SetScale(scale) - Defines the scale relative to an immediate parent or standard coordinate space, depending on IsIgnoringParentScale()
Region:SetIgnoreParentScale() - Directs the region to scale itself manually without inheritence
Computed size and location
Region:GetLeft() - Returns the distance from the left edge of the screen (scale dependent)
Region:GetBottom() - Returns the distance from the bottom edge of the screen (scale dependent)
Region:GetRight() - Returns the distance from the bottom of the screen (scale dependent)
Region:GetTop() - Returns the distance of the top edge from the bottom of the screen (scale dependent)
Region:GetCenter() - Returns the distance of the region's middle from the bottom-left corner of the screen (scale dependent)
Region:GetWidth() - Returns the width of this object (scale dependent)
Region:GetHeight() - Returns the height of this object (scale dependent)
Region:GetSize() - Returns the width and height (scale dependent)
Region:GetRect() - Returns the location and size (scale dependent), as shorthand for GetBottom(), GetLeft(), GetWidth() and GetHeight()
Region:GetScaledRect() - Returns the location and size in a standard coordinate space (as if effectiveScale = 1)
Region:IsRectValid() - Indicates the region has been sufficiently defined for placement on the screen
Region:GetScale() - Returns the set scale (normally relative to its parent)
Region:GetEffectiveScale() - Returns the net scale, inclusive of all parents
Region:IsIgnoringParentScale() - Indicates the region scales itself manually without inheritence
Visibilty
Region:Hide() - Directs the region and its children to disappear
Region:Show() - Directs the region to appear and permits its children to appear also, but not while the region's parent (if any) is hidden
Region:SetShown(boolean) - Directs the region to appear or disappar, as an alternative to Hide() and Show()
Region:IsShown() - Indicates the region will appear, but only while its parent appears or if it has no parent
Region:IsVisible() - Indicates the region and its parent (if any) are currently appearing
Opacity
Region:GetAlpha() - Returns the object's set opacity between 0 and 1 (normally relative to its parent)
Region:GetEffectiveAlpha() - Return's the net opacity, inclusive of all parents
Region:SetAlpha(alpha) - Defines the object's opacity between 0 and 1 (normally relative to its parent)
Region:SetIgnoreParentAlpha(boolean) - Directs the region to adopt a manually defined opacity uninherited from its parent
Region:IsIgnoringParentAlpha() - Indicates the region has a manually defined opacity uninherited from its parent
Other methods
Region:CanChangeProtectedState()[citation needed] 
Region:CreateAnimationGroup() - Constructs a new AnimationGroup as a child of this Region. - New in 3.1.0
Region:GetAnimationGroups() - Returns all AnimationGroups that are children of this Region. - New in 3.1.0
Region:IsDragging() - True if this Region or its Parent is being dragged. - New in 3.1.0
Region:IsMouseOver([top, bottom, left, right]) - Checks whether the mouse is over the frame (or within specified offsets).
Region:IsObjectLoaded()[citation needed] 
Region:IsProtected() - Indicates if this object can be manipulated in certain ways by tainted code in combat or not
Region:StopAnimating() - Halts any active Animations on the Region and its children - New in 3.1.0

Notes

  • The existence of this abstract class may be inferred from UIObject:IsObjectType and blue posts[1]; however, it is unknown precisely how Blizzard has coded inheritance.
    • Some of these functions may have a standard form which is then overriden by one or more subtypes
    • Some of these functions may not even exist in Region, but be implemented (by coincidence or design) by all of its subtypes

Patch changes

See also

  • Animation - another object type that acts on a Region by changing one of its properties over time
  • GetUnscaledFrameRect(frame, scale) - FrameXML extension to return the location and size of a region in an arbitrary coordinate space

References

 
  1. ^ a b Iriel and Blizzard Entertainment Slouken 2006-03-28. Upcoming 1.11 Changes - Concise List. Archived from the original
    Consolidated by Cairenn 2006-05-23. Wow Interface: Upcoming 1.11 Changes.
Advertisement