MaskTexture

From Warcraft Wiki
Jump to navigation Jump to search
Instantiation Frame:CreateMaskTexture()

Example

Applies a circle texture mask.

local f = CreateFrame("Frame", nil, UIParent)
f:SetPoint("CENTER")
f:SetSize(32, 32)

f.tex = f:CreateTexture(nil, "ARTWORK")
f.tex:SetAllPoints(f)
f.tex:SetTexture("Interface/Tooltips/UI-Tooltip-Background")
f.tex:SetColorTexture(0, 0, 0, 0.5) -- black, 50% opacity

f.mask = f:CreateMaskTexture()
f.mask:SetAllPoints(f.tex)
f.mask:SetTexture("Interface/CHARACTERFRAME/TempPortraitAlphaMask", "CLAMPTOBLACKADDITIVE", "CLAMPTOBLACKADDITIVE")
f.tex:AddMaskTexture(f.mask)

UIOBJECT MaskTexture1.png

Methods

TextureBase:ClearTextureSlice()
TextureBase:GetAtlas() : atlas - Returns the atlas for the texture.
TextureBase:GetBlendMode() : blendMode - Returns the blend mode of the texture.
TextureBase:GetDesaturation() : desaturation - Returns the desaturation level of the texture.
TextureBase:GetHorizTile() : tiling - Returns true if the texture is tiling horizontally.
TextureBase:GetRotation() : radians, normalizedRotationPoint - Returns the rotation of the texture.
TextureBase:GetTexCoord() : ULx, ULy, LLx, LLy, URx, URy, LRx, LRy - Returns the texture space coordinates of the texture.
TextureBase:GetTexelSnappingBias() : bias - Returns the texel snapping bias for the texture.
TextureBase:GetTexture() : textureFile - Returns the FileID for the texture.
TextureBase:GetTextureFileID() : textureFile - Returns the FileID for the texture.
TextureBase:GetTextureFilePath() : textureFile - Returns the FileID for the texture.
TextureBase:GetTextureSliceMargins() : left, top, right, bottom
TextureBase:GetTextureSliceMode() : sliceMode
TextureBase:GetVertTile() : tiling - Returns true if the texture is tiling vertically.
TextureBase:GetVertexOffset(vertexIndex) : offsetX, offsetY - Returns a vertex offset for the texture.
TextureBase:IsBlockingLoadRequested() : blocking
TextureBase:IsDesaturated() : desaturated - Returns true if the texture is desaturated.
TextureBase:IsSnappingToPixelGrid() : snap - Returns true if the texture is snapping to the pixel grid.
TextureBase:SetAtlas(atlas [, useAtlasSize, filterMode, resetTexCoords]) - Sets the texture to an atlas.
TextureBase:SetBlendMode(blendMode) - Sets the blend mode of the texture.
TextureBase:SetBlockingLoadsRequested([blocking])
TextureBase:SetColorTexture(colorR, colorG, colorB [, a]) - Sets the texture to a solid color.
TextureBase:SetDesaturated([desaturated]) - Sets the texture to be desaturated.
TextureBase:SetDesaturation(desaturation) - Sets the desaturation level of the texture.
TextureBase:SetGradient(orientation, minColor, maxColor) - Sets a gradient color shading for the texture.
TextureBase:SetHorizTile([tiling]) - Sets whether the texture should tile horizontally.
TextureBase:SetMask(file) - Applies a mask to the texture.
TextureBase:SetRotation(radians [, normalizedRotationPoint]) - Applies a rotation to the texture.
TextureBase:SetSnapToPixelGrid([snap]) - Sets the texture to snap to the pixel grid.
TextureBase:SetTexCoord(left, right, top, bottom) - Sets the coordinates for cropping or transforming the texture.
TextureBase:SetTexelSnappingBias(bias) - Returns the texel snapping bias for the texture.
TextureBase:SetTexture([textureAsset, wrapModeHorizontal, wrapModeVertical, filterMode]) - Sets the texture to an image.
TextureBase:SetTextureSliceMargins(left, top, right, bottom)
TextureBase:SetTextureSliceMode(sliceMode)
TextureBase:SetVertTile([tiling]) - Sets whether the texture should tile vertically.
TextureBase:SetVertexOffset(vertexIndex, offsetX, offsetY) - Sets a vertex offset for the texture.
Collapse
Region:GetAlpha() : alpha - Returns the region's opacity.
Region:GetDrawLayer() : layer, sublayer - Returns the layer in which the region is drawn.
Region:GetEffectiveScale() : effectiveScale - Returns the scale of the region after propagating from its parents.
Region:GetScale() : scale - Returns the scale of the region.
Region:GetVertexColor() : colorR, colorG, colorB, colorA - Returns the vertex color shading of the region.
Region:IsIgnoringParentAlpha() : isIgnoring - Returns true if the region is ignoring parent alpha.
Region:IsIgnoringParentScale() : isIgnoring - Returns true if the region is ignoring parent scale.
Region:IsObjectLoaded() : isLoaded - Returns true if the region is fully loaded.
Region:SetAlpha(alpha) - Sets the opacity of the region.
Region:SetDrawLayer(layer [, sublevel]) - Sets the layer in which the region is drawn.
Region:SetIgnoreParentAlpha(ignore) - Sets whether the region should ignore its parent's alpha.
Region:SetIgnoreParentScale(ignore) - Sets whether the region should ignore its parent's scale.
Region:SetScale(scale) - Sets the size scaling of the region.
Region:SetVertexColor(colorR, colorG, colorB [, a]) - Sets the vertex shading color of the region.
ScriptRegion:CanChangeProtectedState() : canChange - Returns true if protected properties of the region can be changed by non-secure scripts.
ScriptRegion:EnableMouse([enable]) - Sets whether the region should receive mouse input.
ScriptRegion:EnableMouseMotion([enable]) - Sets whether the region should receive mouse hover events.
ScriptRegion:EnableMouseWheel([enable]) - Sets whether the region should receive mouse wheel input.
ScriptRegion:GetBottom() : bottom #restrictedframe - Returns the offset to the bottom edge of the region.
ScriptRegion:GetCenter() : x, y #restrictedframe - Returns the offset to the center of the region.
ScriptRegion:GetHeight([ignoreRect]) : height - Returns the height of the region.
ScriptRegion:GetLeft() : left #restrictedframe - Returns the offset to the left edge of the region.
ScriptRegion:GetRect() : left, bottom, width, height #restrictedframe - Returns the coords and size of the region.
ScriptRegion:GetRight() : right #restrictedframe - Returns the offset to the right edge of the region.
ScriptRegion:GetScaledRect() : left, bottom, width, height - Returns the scaled coords and size of the region.
ScriptRegion:GetSize([ignoreRect]) : width, height - Returns the width and height of the region.
ScriptRegion:GetSourceLocation() : location - Returns the script name and line number where the region was created.
ScriptRegion:GetTop() : top #restrictedframe - Returns the offset to the top edge of the region.
ScriptRegion:GetWidth([ignoreRect]) : width - Returns the width of the region.
ScriptRegion:Hide() #secureframe - Hides the region.
ScriptRegion:IsAnchoringRestricted() : isRestricted - Returns true if the region has cross-region anchoring restrictions applied.
ScriptRegion:IsDragging() : isDragging - Returns true if the region is being dragged.
ScriptRegion:IsMouseClickEnabled() : enabled - Returns true if the region can receive mouse clicks.
ScriptRegion:IsMouseEnabled() : enabled - Returns true if the region can receive mouse input.
ScriptRegion:IsMouseMotionEnabled() : enabled - Returns true if the region can receive mouse hover events.
ScriptRegion:IsMouseMotionFocus() : isMouseMotionFocus - Returns true if the mouse cursor is hovering over the region.
ScriptRegion:IsMouseOver([offsetTop, offsetBottom, offsetLeft, offsetRight]) : isMouseOver - Returns true if the mouse cursor is hovering over the region.
ScriptRegion:IsMouseWheelEnabled() : enabled - Returns true if the region can receive mouse wheel input.
ScriptRegion:IsProtected() : isProtected, isProtectedExplicitly - Returns whether the region is currently protected.
ScriptRegion:IsRectValid() : isValid - Returns true if the region can be positioned on the screen.
ScriptRegion:IsShown() : isShown - Returns true if the region should be shown; it depends on the parents if it's visible.
ScriptRegion:IsVisible() : isVisible - Returns true if the region and its parents are shown.
ScriptRegion:SetMouseClickEnabled([enabled]) - Sets whether the region should receive mouse clicks.
ScriptRegion:SetMouseMotionEnabled([enabled]) - Sets whether the region should receive mouse hover events.
ScriptRegion:SetParent([parent]) - Sets the parent of the region.
ScriptRegion:SetPassThroughButtons([button1, ...]) #nocombat - Allows the region to propagate mouse clicks to underlying regions or the world frame.
ScriptRegion:SetProtected()
ScriptRegion:SetShown([show]) #secureframe - Shows or hides the region.
ScriptRegion:Show() #secureframe - Shows the region.
ScriptRegionResizing:AdjustPointsOffset(x, y) #secureframe - Adjusts the x and y offset of the region.
ScriptRegionResizing:ClearAllPoints() - Removes all anchor points from the region.
ScriptRegionResizing:ClearPoint(point) - Removes an anchor point from the region by name.
ScriptRegionResizing:ClearPointsOffset() #secureframe - Resets the x and y offset on the region to zero.
ScriptRegionResizing:GetNumPoints() : numPoints - Returns the number of anchor points for the region.
ScriptRegionResizing:GetPoint([anchorIndex]) : point, relativeTo, relativePoint, offsetX, offsetY #restrictedframe - Returns an anchor point for the region.
ScriptRegionResizing:GetPointByName(point) : point, relativeTo, relativePoint, offsetX, offsetY - Returns an anchor point by name for the region.
ScriptRegionResizing:SetAllPoints(relativeTo [, doResize]) - Positions the region the same as another region.
ScriptRegionResizing:SetHeight(height) - Sets the height of the region.
ScriptRegionResizing:SetPoint(point, relativeTo, relativePoint, offsetX, offsetY) #anchorfamily - Sets an anchor point for the region.
ScriptRegionResizing:SetSize(x, y) - Sets the width and height of the region.
ScriptRegionResizing:SetWidth(width) - Sets the width of the region.
AnimatableObject:CreateAnimationGroup([name, templateName]) : group - Creates an animation group.
AnimatableObject:GetAnimationGroups() : scriptObject, ... - Returns the animation groups of this region.
AnimatableObject:StopAnimating() - Stops any active animations on this region.
ScriptObject:GetScript(scriptTypeName [, bindingType]) : script - Returns the widget script handler.
ScriptObject:HasScript(scriptName) : hasScript - Returns true if the region supports the given script type.
ScriptObject:HookScript(scriptTypeName, script [, bindingType]) - Securely post-hooks a widget script handler.
ScriptObject:SetScript(scriptTypeName [, script]) - Sets the widget script handler.
Object:ClearParentKey() - Clears the parent key.
Object:GetDebugName([preferParentKey]) : debugName - Returns the object's debug name.
Object:GetParent() : parent - Returns the parent object.
Object:GetParentKey() : parentKey - Returns the key on the parent that references this object.
Object:SetParentKey(parentKey [, clearOtherKeys]) - Sets a key on the parent to the child object.
FrameScriptObject:GetName() : name - Returns the object's global name.
FrameScriptObject:GetObjectType() : objectType - Returns the object's widget type.
FrameScriptObject:IsForbidden() : isForbidden - Returns true if insecure interaction with the object is forbidden.
FrameScriptObject:IsObjectType(objectType) : isType - Returns true if the object belongs to a given widget type or its subtypes.
FrameScriptObject:SetForbidden() #protected - Sets the object to be forbidden from an insecure execution path.

Script Types

OnShow(self) - Invoked when the widget is shown.
OnHide(self) - Invoked when the widget is hidden.
OnEnter(self, motion) - Invoked when the cursor enters the widget's interactive area.
OnLeave(self, motion) - Invoked when the mouse cursor leaves the widget's interactive area.
OnMouseDown(self, button) - Invoked when a mouse button is pressed while the cursor is over the widget.
OnMouseUp(self, button, upInside) - Invoked when the mouse button is released following a mouse down action in the widget.
OnMouseWheel(self, delta) - Invoked when the widget receives a mouse wheel scrolling action.
OnLoad(self) - Invoked when the widget is created.

Patch changes

References