Textures are visible areas descended from LayeredRegion, that display either a color block, a gradient, or a graphic raster taken from a .tga or .blp file. Most of their methods relate to setting their appearance or their source information.
Textures are created as children of Frame elements in XML, or by calling Frame:CreateTexture() from Lua. They cannot be reassigned from one frame to another, although you can create another texture on another frame that has the same source. They can also be created in XML with the virtual tag, allowing several similar textures to be created easily.
The WoW client only loads those files that existed when the client was first opened. If you add texture files to your addon's directory, you will need to restart your client in order for those textures to be loadable by the client. Changes to existing files do not have this same restriction.
Defined Methods
- mode = Texture:GetBlendMode() - Returns the blend mode of the texture
- Texture:GetHorizTile() - This function is not yet documented
- nonBlocking = Texture:GetNonBlocking() - Returns whether the texture object loads its image file in the background
- ULx, ULy, LLx, LLy, URx, URy, LRx, LRy = Texture:GetTexCoord() - Returns corner coordinates for scaling or cropping the texture image
- texture = Texture:GetTexture() - Returns the path to the texture's image file
- Texture:GetVertTile() - This function is not yet documented
- red, green, blue, alpha = Texture:GetVertexColor() - Returns the shading color of the texture
- desaturated = Texture:IsDesaturated() - Returns whether the texture image should be displayed with zero saturation (i.e. converted to grayscale)
- Texture:SetBlendMode("mode") - Sets the blend mode of the texture
- supported = Texture:SetDesaturated(desaturate) - Sets whether the texture image should be displayed with zero saturation (i.e. converted to grayscale)
- Texture:SetGradient("orientation", startR, startG, startB, endR, endG, endB) - Sets a gradient color shading for the texture
- Texture:SetGradientAlpha("orientation", startR, startG, startB, startAlpha, endR, endG, endB, endAlpha) - Sets a gradient color shading for the texture (including opacity in the gradient)
- Texture:SetHorizTile() - This function is not yet documented
- Texture:SetNonBlocking(nonBlocking) - Sets whether the texture object loads its image file in the background
- Texture:SetRotation(radians) - Rotates the texture image
- Texture:SetShown() - This function is not yet documented
- Texture:SetTexCoord(left, right, top, bottom) or Texture:SetTexCoord(ULx, ULy, LLx, LLy, URx, URy, LRx, LRy) - Sets corner coordinates for scaling or cropping the texture image
- visible = Texture:SetTexture("texture") or Texture:SetTexture(red, green, blue [, alpha]) - Sets the texture object's image or color
- Texture:SetVertTile() - This function is not yet documented
Inherited Methods
- canChange = Texture:CanChangeProtectedState() - Returns whether protected properties of the region can be changed by non-secure scripts
- Texture:ClearAllPoints() - Removes all anchor points from the region
- animationGroup = Texture:CreateAnimationGroup(["name" [, "inheritsFrom"]]) - Creates a new AnimationGroup as a child of the region
- alpha = Texture:GetAlpha() - Returns the opacity of the region relative to its parent
- ... = Texture:GetAnimationGroups() - Returns a list of animation groups belonging to the region
- bottom = Texture:GetBottom() - Returns the distance from the bottom of the screen to the bottom of the region
- x, y = Texture:GetCenter() - Returns the screen coordinates of the region's center
- layer, sublayer = Texture:GetDrawLayer() - Returns the layer at which the region's graphics are drawn relative to others in its frame
- height = Texture:GetHeight() - Returns the height of the region
- left = Texture:GetLeft() - Returns the distance from the left edge of the screen to the left edge of the region
- name = Texture:GetName() - Returns the widget object's name
- numPoints = Texture:GetNumPoints() - Returns the number of anchor points defined for the region
- type = Texture:GetObjectType() - Returns the object's widget type
- parent = Texture:GetParent() - Returns the object's parent object
- point, relativeTo, relativePoint, xOffset, yOffset = Texture:GetPoint(index) - Returns information about one of the region's anchor points
- left, bottom, width, height = Texture:GetRect() - Returns the position and dimensions of the region
- right = Texture:GetRight() - Returns the distance from the left edge of the screen to the right edge of the region
- width, height = Texture:GetSize() - Returns the width and height of the region
- top = Texture:GetTop() - Returns the distance from the bottom of the screen to the top of the region
- width = Texture:GetWidth() - Returns the width of the region
- Texture:Hide() - Hides the region
- isDragging = Texture:IsDragging() - Returns whether the region is currently being dragged
- isOver = Texture:IsMouseOver([topOffset [, leftOffset [, bottomOffset [, rightOffset]]]]) - Returns whether the mouse cursor is over the given region
- isType = Texture:IsObjectType("type") - Returns whether the object belongs to a given widget type
- isProtected, explicit = Texture:IsProtected() - Returns whether the region is protected
- shown = Texture:IsShown() - Returns whether the region is shown
- visible = Texture:IsVisible() - Returns whether the region is visible
- Texture:SetAllPoints([region]) or Texture:SetAllPoints(["name"]) - Sets all anchor points of the region to match those of another region
- Texture:SetAlpha(alpha) - Sets the opacity of the region relative to its parent
- Texture:SetDrawLayer("layer", sublayer) - Sets the layer at which the region's graphics are drawn relative to others in its frame
- Texture:SetHeight(height) - Sets the region's height
- Texture:SetParent(frame) or Texture:SetParent("name") - Makes another frame the parent of this region
- Texture:SetPoint("point" [, relativeTo [, "relativePoint" [, xOffset [, yOffset]]]]) - Sets an anchor point for the region
- Texture:SetSize(width, height) - Sets the size of the region to the specified values
- Texture:SetVertexColor(red, green, blue [, alpha]) - Sets a color shading for the region's graphics
- Texture:SetWidth(width) - Sets the region's width
- Texture:Show() - Shows the region
- Texture:StopAnimating() - Stops any active animations involving the region or its children