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. |
||
⚫ | |||
− | Regions are abstract rectangular areas of the screen, providing common API inheritted by concrete subtypes such as [[{{#if:{{{1|}}}|Widget API#|UIOBJECT }}Frame|Frame]], [[{{#if:{{{1|}}}|Widget API#|UIOBJECT }}Texture|Texture]] or [[{{#if:{{{1|}}}|Widget API#|UIOBJECT }}FontString|FontString]]. |
||
− | <includeonly><div style="font-size:smaller; float:right;">{{Edit|UIOBJECT Region|Edit Region}}</div></includeonly> |
||
− | </onlyinclude> |
||
− | == |
+ | == 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. |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
+ | ; 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:ClearAllPoints()}} - Removes all previously-defined attachment points for this region. |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
+ | : {{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: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. |
||
⚫ | |||
− | *[[UIOBJECT Frame|Frame]] |
||
⚫ | |||
− | *[[UIOBJECT LayeredRegion|LayeredRegion]] |
||
⚫ | |||
− | **[[UIOBJECT Texture|Texture]] |
||
⚫ | |||
− | **[[UIOBJECT FontString|FontString]] |
||
+ | : {{api|t=w|Region:GetSize()}} - Returns the width and height (scale dependent). |
||
⚫ | |||
+ | : {{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> |
||
⚫ | |||
− | [[UIOBJECT Region|Region]] has all the methods from [[{{#if:{{{1|}}}|Widget API#|UIOBJECT }}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: |
+ | : {{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: |
+ | : {{api|t=w|Region:IsVisible()}} - Indicates the region and its parent (if any) are currently appearing |
− | : {{api|t=w|Region:GetAlpha |
+ | : {{api|t=w|Region:GetAlpha()}} - Returns the object's set opacity between 0 and 1 (normally relative to its parent) |
− | : {{api|t=w|Region: |
+ | : {{api|t=w|Region:GetEffectiveAlpha()}} - Return's the net opacity, inclusive of all parents |
− | : {{api|t=w|Region: |
+ | : {{api|t=w|Region:SetAlpha(alpha)}} - Defines the object's opacity between 0 and 1 (normally relative to its parent) |
− | : {{api|t=w|Region: |
+ | : {{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 |
||
⚫ | |||
+ | |||
⚫ | |||
+ | ; Animations |
||
⚫ | |||
− | : {{api|t=w|Region: |
+ | : {{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: |
+ | : {{api|t=w|Region:GetAnimationGroups()}} - Returns all AnimationGroups that are children of this Region. - New in 3.1.0 |
− | : {{api|t=w|Region: |
+ | : {{api|t=w|Region:StopAnimating()}} - Halts any active {{api|t=o|Animation|Animations}} on the Region and its children - New in 3.1.0 |
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
− | : {{api|t=w|Region:GetSize}}() |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
− | : {{api|t=w|Region:IsIgnoringParentAlpha}}() |
||
− | : {{api|t=w|Region:IsIgnoringParentScale}}() |
||
⚫ | |||
⚫ | |||
⚫ | |||
− | : {{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:SetAlpha}}(alpha) - Set the object's alpha (opacity) value. |
||
⚫ | |||
− | : {{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:SetScale}}(scale) |
||
− | : {{api|t=w|Region:SetShown}}(shownFlag) - Shows or hides the region. |
||
⚫ | |||
⚫ | |||
− | : {{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 |
+ | * {{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}} |
− | + | : {{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
The API is no longer being updated here until further notice. |
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
- Patch 1.11.0 (2006-06-19): Added as the base object type for all Frames, Textures and FontStrings.[1]
External links
- wowprogramming, Jim Whitehead
References
- ^ Iriel and Slouken 2006-03-28. Upcoming 1.11 Changes - Concise List. Archived from the original
- Cairenn 2006-05-23. Wow Interface: Upcoming 1.11 Changes.