Wowpedia

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

READ MORE

Wowpedia
No edit summary
Tag: WoW API docs
(→‎Defined Methods: Adding descriptions)
Tag: WoW API docs
(34 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{widget}}
 
{{widget}}
  +
<onlyinclude>{{api|t=o|Region}} (inherits from {{api|t=o|ParentedObject}}) is an abstract widget type for anything that can occupy an area of the screen.</onlyinclude> As such, Frames, Textures and FontStrings are all various kinds of Region. Region provides most of the functions that support size, position and anchoring, including animation. It is a "real virtual" type; it cannot be instantiated, but objects can return true when asked if they are Regions.
<onlyinclude>
 
Regions are abstract rectangular areas of the screen, providing common API inheritted by concrete subtypes such as [[{{#if:{{{1|}}}|Widget API#|UIOBJECT&nbsp;}}Frame|Frame]], [[{{#if:{{{1|}}}|Widget API#|UIOBJECT&nbsp;}}Texture|Texture]] or [[{{#if:{{{1|}}}|Widget API#|UIOBJECT&nbsp;}}FontString|FontString]].
 
<includeonly><div style="font-size:smaller; float:right;">{{Edit|UIOBJECT Region|Edit Region}}</div></includeonly>
 
</onlyinclude>
 
   
== Class Hierarchy ==
+
== Defined Methods ==
  +
<onlyinclude>{{#switch:{{{t|wm}}}|w|wm|widgetmethod=
  +
: {{api|t=w|Region:SetParent(parent)}} - Parents this to another object. Parented objects will inherit their scale & visibility.
 
: {{api|t=w|Region:IsDragging()}} - True if this Region or its Parent is being dragged. - New in 3.1.0
 
: {{api|t=w|Region:IsMouseOver([top, bottom, left, right])}} - Checks whether the mouse is over the frame (or within specified offsets).
 
: {{api|t=w|Region:IsObjectLoaded()}}
 
: {{api|t=w|Region:IsProtected()}} - Indicates if this object can be manipulated in certain ways by tainted code in combat or not
 
: {{api|t=w|Region:CanChangeProtectedState()}}
   
  +
; Position & Scale
*[[UIOBJECT_UIObject|UIObject]]
 
  +
: {{api|t=w|Region:GetPoint(index)}} - Returns the details of the indexth anchor point defined for this frame (point, relativeTo, relativePoint, xofs, yofs).
**[[UIOBJECT_Region|Region]]
 
 
: {{api|t=w|Region:SetPoint(point, relativeTo, relativePoint, ofsx, ofsy)}} - Defines an attachment point of this region.
 
: {{api|t=w|Region:SetAllPoints(frame or frameName)}} - Defines attachment points for this region to match edges of the specified frame.
  +
: {{api|t=w|Region:ClearAllPoints()}} - Removes all previously-defined attachment points for this region.
 
: {{api|t=w|Region:GetNumPoints()}} - Returns the number of anchor points defined for this frame.
 
: {{api|t=w|Region:IsAnchoringRestricted()}}
 
: {{api|t=w|Region:GetPointByName(name)}}
 
: {{api|t=w|Region:ClearPointByName(name)}}
  +
: {{api|t=w|Region:AdjustPointsOffset([adjustX, adjustY])}} - Shifts a region by adjusting all anchors.
  +
: {{api|t=w|Region:ClearPointsOffset()}} - Zeroizes the x and y offsets on all anchors.
   
  +
: {{api|t=w|Region:GetLeft()}} - Returns the distance of the region's left edge from the left side of the screen (scale dependent).
== Derivatives ==
 
 
: {{api|t=w|Region:GetRight()}} - Returns the distance of the region's right edge from the left side of the screen (scale dependent).
 
: {{api|t=w|Region:GetTop()}} - Returns the distance of the region's top edge from the bottom of the screen (scale dependent).
  +
: {{api|t=w|Region:GetBottom()}} - Returns the distance of the region's bottom edge from the bottom of the screen (scale dependent).
  +
: {{api|t=w|Region:GetCenter()}} - Returns the distance of the region's middle from the bottom left of the screen (scale dependent).
  +
: {{api|t=w|Region:GetRect()}} - Returns the location and size (scale dependent), as shorthand for GetBottom(), GetLeft(), GetWidth() and GetHeight()
  +
: {{api|t=w|Region:GetScaledRect()}} - Returns the location and size in a standard coordinate space (as if effectiveScale = 1).
  +
: {{api|t=w|Region:IsRectValid()}} - Indicates the region has been sufficiently defined for placement on the screen.
   
 
: {{api|t=w|Region:GetWidth()}} - Returns the width of this object (scale dependent).
*[[UIOBJECT Frame|Frame]]
 
 
: {{api|t=w|Region:SetWidth(width)}} - Defines the width of the object (scale dependent).
*[[UIOBJECT LayeredRegion|LayeredRegion]]
 
 
: {{api|t=w|Region:GetHeight()}} - Returns the height of this object (scale dependent).
**[[UIOBJECT Texture|Texture]]
 
 
: {{api|t=w|Region:SetHeight(height)}} - Defines the height of the object (scale dependent).
**[[UIOBJECT FontString|FontString]]
 
  +
: {{api|t=w|Region:GetSize()}} - Returns the width and height (scale dependent).
 
: {{api|t=w|Region:SetSize(width, height)}} - Defines the width and the height, as shorthand for SetWidth() and SetHeight()
  +
: {{api|t=w|Region:GetScale()}} - Returns the set scale (normally relative to its parent).
  +
: {{api|t=w|Region:SetScale(scale)}} - Defines the scale relative to an immediate parent or standard coordinate space, depending on IsIgnoringParentScale()
  +
: {{api|t=w|Region:GetEffectiveScale()}} - Returns the net scale, inclusive of all parents.
  +
: {{api|t=w|Region:SetIgnoreParentScale(boolean)}} - Directs the region to scale itself manually without inheritence.
  +
: {{api|t=w|Region:IsIgnoringParentScale()}} - Indicates the region scales itself manually without inheritence.
   
  +
; Visibility
== API ==
 
  +
: {{api|t=w|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
<onlyinclude>
 
 
: {{api|t=w|Region:Hide()}} - Directs the region and its children to disappear
[[UIOBJECT Region|Region]] has all the methods from [[{{#if:{{{1|}}}|Widget API#|UIOBJECT&nbsp;}}UIObject|UIObject]], plus the following:
 
  +
: {{api|t=w|Region:SetShown(boolean)}} - Directs the region to appear or disappar, as an alternative to Hide() and Show()
: {{api|t=w|Region:CanChangeProtectedState}}()
 
: {{api|t=w|Region:ClearAllPoints}}() - Clear all attachment points for this object.
+
: {{api|t=w|Region:IsShown()}} - Indicates the region will appear, but only while its parent appears or if it has no parent
: {{api|t=w|Region:CreateAnimationGroup}}) - Create and return a new AnimationGroup as a child of this Region. - New in 3.1.0
+
: {{api|t=w|Region:IsVisible()}} - Indicates the region and its parent (if any) are currently appearing
: {{api|t=w|Region:GetAlpha}}() - Return this object's alpha (opacity) value.
+
: {{api|t=w|Region:GetAlpha()}} - Returns the object's set opacity between 0 and 1 (normally relative to its parent)
: {{api|t=w|Region:GetAnimationGroups}}() - Returns all AnimationGroups that are children of this Region. - New in 3.1.0
+
: {{api|t=w|Region:GetEffectiveAlpha()}} - Return's the net opacity, inclusive of all parents
: {{api|t=w|Region:GetBottom}}() - Get the y location of the bottom edge of this frame
+
: {{api|t=w|Region:SetAlpha(alpha)}} - Defines the object's opacity between 0 and 1 (normally relative to its parent)
: {{api|t=w|Region:GetCenter}}() - Get the coordinates of the center of this frame - Moved in 1.10.
+
: {{api|t=w|Region:SetIgnoreParentAlpha(boolean)}} - Directs the region to adopt a manually defined opacity uninherited from its parent
  +
: {{api|t=w|Region:IsIgnoringParentAlpha()}} - Indicates the region has a manually defined opacity uninherited from its parent
: {{api|t=w|Region:GetEffectiveScale}}()
 
  +
: {{api|t=w|Region:GetHeight}}() - Get the height of this object.
 
  +
; Animations
: {{api|t=w|Region:GetLeft}}() - Get the x location of the left edge of this frame
 
: {{api|t=w|Region:GetNumPoints}}() - Get the number of anchor points for this frame
+
: {{api|t=w|Region:CreateAnimationGroup()}} - Constructs a new {{api|t=o|AnimationGroup}} as a child of this Region. - New in 3.1.0
: {{api|t=w|Region:GetPoint}}(pointNum) - Get details for an anchor point for this frame (point, relativeTo, relativePoint, xofs, yofs)
+
: {{api|t=w|Region:GetAnimationGroups()}} - Returns all AnimationGroups that are children of this Region. - New in 3.1.0
: {{api|t=w|Region:GetRect}}() - Get frame's left, bottom, width, height.
+
: {{api|t=w|Region:StopAnimating()}} - Halts any active {{api|t=o|Animation|Animations}} on the Region and its children - New in 3.1.0
 
}}</onlyinclude>
: {{api|t=w|Region:GetRight}}() - Get the x location of the right edge of this frame
 
: {{api|t=w|Region:GetScale}}()
 
: {{api|t=w|Region:GetScaledRect}}()
 
: {{api|t=w|Region:GetSize}}()
 
: {{api|t=w|Region:GetTop}}() - Get the y location of the top edge of this frame
 
: {{api|t=w|Region:GetWidth}}() - Get the width of this object.
 
: {{api|t=w|Region:Hide}}() - Set this object to hidden (it and all of its children will disappear).
 
: {{api|t=w|Region:IsDragging}}() - True if this Region or its Parent is being dragged. - New in 3.1.0
 
: {{api|t=w|Region:IsIgnoringParentAlpha}}()
 
: {{api|t=w|Region:IsIgnoringParentScale}}()
 
: {{api|t=w|Region:IsMouseOver}}([top, bottom, left, right]) - Checks whether the mouse is over the frame (or within specified offsets).
 
: {{api|t=w|Region:IsObjectLoaded}}()
 
: {{api|t=w|Region:IsProtected}}() - Determine if this object can be manipulated in certain ways by tainted code in combat or not
 
: {{api|t=w|Region:IsRectValid}}()
 
: {{api|t=w|Region:IsShown}}() - Determine if this object is shown (would be visible if its parent was visible).
 
: {{api|t=w|Region:IsVisible}}() - Get whether the object is visible on screen (logically (IsShown() and GetParent():IsVisible()));
 
: {{api|t=w|Region:SetAllPoints}}(frame or "frameName") - Set all anchors to match edges of specified frame
 
: {{api|t=w|Region:SetAlpha}}(alpha) - Set the object's alpha (opacity) value.
 
: {{api|t=w|Region:SetHeight}}(height) - Set the height of the object.
 
: {{api|t=w|Region:SetIgnoreParentAlpha}}(boolean) - Set if this frame should ignore its parent Alpha.
 
: {{api|t=w|Region:SetIgnoreParentScale}}()
 
: {{api|t=w|Region:SetParent}}(parent or "parentName") - Set the parent for this frame - Moved in 1.10.
 
: {{api|t=w|Region:SetPoint}}) - Set an attachment point of this object
 
: {{api|t=w|Region:SetScale}}(scale)
 
: {{api|t=w|Region:SetShown}}(shownFlag) - Shows or hides the region.
 
: {{api|t=w|Region:SetSize}}(width,height) - Sets the width and the height of the object as SetHeight and SetWidth do, but in one function.
 
: {{api|t=w|Region:SetWidth}}(width) - Set the width of the object.
 
: {{api|t=w|Region:Show}}() - Set this object to shown (it will appear if its parent is visible).
 
: {{api|t=w|Region:StopAnimating}}() - Stops any active animations on the Region and its children. - New in 3.1.0
 
</onlyinclude>
 
   
 
== Patch changes ==
 
== Patch changes ==
*{{Patch 1.11.0|note=Added, effectively similar to [[XML/LayoutFrame]]<ref>{{ref web|author=[[Iriel]] and [[Slouken]]|date=2006-03-28|title=Upcoming 1.11 Changes - Concise List|url=http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=343889&p=1&tmp=1#post343889|archivedate=2006-08-04|archiveurl=http://blue.cardplace.com/cache/wow-interface-customization/343889.htm}}
+
* {{Patch 1.11.0|note=Added as the base object type for all {{api|t=o|Frame}}s, {{api|t=o|Texture}}s and {{api|t=o|FontString}}s.<ref name="1.11.0">{{ref web|author=[[Iriel]] and {{Blizz}}[[Slouken]]|date=2006-03-28|title=Upcoming 1.11 Changes - Concise List|url=http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=343889&p=1&tmp=1#post343889|archiveurl=http://blue.cardplace.com/cache/wow-interface-customization/343889.htm}}
:: Consolidated by {{ref web|author=Cairenn|date=2006-05-23|url=https://www.wowinterface.com/forums/showthread.php?t=4859|title=Wow Interface: Upcoming 1.11 Changes}}</ref>}}
+
: {{ref web|author=Cairenn|date=2006-05-23|url=https://www.wowinterface.com/forums/showthread.php?t=4859|title=Wow Interface: Upcoming 1.11 Changes}}</ref>}}
  +
  +
== External links ==
  +
<!-- Please read https://wow.gamepedia.com/Wowpedia:External_links_policy before adding new links. -->
  +
{{Elinks-api|nogit=|wowprog=http://wowprogramming.com/docs/widgets/Region.html}}
   
== References ==
+
== References ==
{{reflist|2}}
 

Revision as of 01:25, 11 November 2021

Region (inherits from ParentedObject) is an abstract widget type for anything that can occupy an area of the screen. As such, Frames, Textures and FontStrings are all various kinds of Region. Region provides most of the functions that support size, position and anchoring, including animation. It is a "real virtual" type; it cannot be instantiated, but objects can return true when asked if they are Regions.

Defined Methods

Region:SetParent(parent) - Parents this to another object. Parented objects will inherit their scale & visibility.
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()
Region:IsProtected() - Indicates if this object can be manipulated in certain ways by tainted code in combat or not
Region:CanChangeProtectedState()
Position & Scale
Region:GetPoint(index) - Returns the details of the indexth anchor point defined for this frame (point, relativeTo, relativePoint, xofs, yofs).
Region:SetPoint(point, relativeTo, relativePoint, ofsx, ofsy) - 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:IsAnchoringRestricted()
Region:GetPointByName(name)
Region:ClearPointByName(name)
Region:AdjustPointsOffset([adjustX, adjustY]) - Shifts a region by adjusting all anchors.
Region:ClearPointsOffset() - Zeroizes the x and y offsets on all anchors.
Region:GetLeft() - Returns the distance of the region's left edge from the left side of the screen (scale dependent).
Region:GetRight() - Returns the distance of the region's right edge from the left side of the screen (scale dependent).
Region:GetTop() - Returns the distance of the region's top edge from the bottom of the screen (scale dependent).
Region:GetBottom() - Returns the distance of the region's bottom edge from the bottom of the screen (scale dependent).
Region:GetCenter() - Returns the distance of the region's middle from the bottom left of the screen (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:GetWidth() - Returns the width of this object (scale dependent).
Region:SetWidth(width) - Defines the width of the object (scale dependent).
Region:GetHeight() - Returns the height of this object (scale dependent).
Region:SetHeight(height) - Defines the height of the object (scale dependent).
Region:GetSize() - Returns the width and height (scale dependent).
Region:SetSize(width, height) - Defines the width and the height, as shorthand for SetWidth() and SetHeight()
Region:GetScale() - Returns the set scale (normally relative to its parent).
Region:SetScale(scale) - Defines the scale relative to an immediate parent or standard coordinate space, depending on IsIgnoringParentScale()
Region:GetEffectiveScale() - Returns the net scale, inclusive of all parents.
Region:SetIgnoreParentScale(boolean) - Directs the region to scale itself manually without inheritence.
Region:IsIgnoringParentScale() - Indicates the region scales itself manually without inheritence.
Visibility
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:Hide() - Directs the region and its children to disappear
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
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
Animations
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:StopAnimating() - Halts any active Animations on the Region and its children - New in 3.1.0

Patch changes

External links

References