Skip to main content
The Progress Texture region displays a textured progress bar or radial fill. It supports horizontal, vertical, and circular progress displays with advanced texture transformation.

Region Type

regionType = "progresstexture"

Default Configuration

local default = {
  foregroundTexture = "Interface\\Addons\\WeakAuras\\PowerAurasMedia\\Auras\\Aura3",
  backgroundTexture = "Interface\\Addons\\WeakAuras\\PowerAurasMedia\\Auras\\Aura3",
  desaturateBackground = false,
  desaturateForeground = false,
  sameTexture = true,
  compress = false,
  blendMode = "BLEND",
  backgroundOffset = 2,
  width = 200,
  height = 200,
  orientation = "VERTICAL",
  inverse = false,
  foregroundColor = {1, 1, 1, 1},
  backgroundColor = {0.5, 0.5, 0.5, 0.5},
  startAngle = 0,
  endAngle = 360,
  user_x = 0,
  user_y = 0,
  crop_x = 0.41,
  crop_y = 0.41,
  rotation = 0,
  mirror = false
}

Orientation Types

  • HORIZONTAL - Fill left to right
  • HORIZONTAL_INVERSE - Fill right to left
  • VERTICAL - Fill bottom to top
  • VERTICAL_INVERSE - Fill top to bottom
  • CLOCKWISE - Circular fill clockwise
  • ANTICLOCKWISE - Circular fill counter-clockwise

Functions

Color

Sets the foreground texture color and alpha.
region:Color(r, g, b, a)
r
number
Red color component (0-1)
g
number
Green color component (0-1)
b
number
Blue color component (0-1)
a
number
Alpha transparency (0-1)
Example:
-- Set foreground to blue
region:Color(0, 0.5, 1, 1)

ColorAnim

Sets animated color values for the foreground.
region:ColorAnim(r, g, b, a)
r
number
Red color component (0-1)
g
number
Green color component (0-1)
b
number
Blue color component (0-1)
a
number
Alpha transparency (0-1)

GetColor

Returns current foreground color values.
local r, g, b, a = region:GetColor()
r
number
Red color component (0-1)
g
number
Green color component (0-1)
b
number
Blue color component (0-1)
a
number
Alpha transparency (0-1)

SetValueOnTexture

Sets the progress value (0-1) and updates the texture display.
region:SetValueOnTexture(progress)
progress
number
Progress value from 0 to 1
Example:
-- Set to 75% progress
region:SetValueOnTexture(0.75)

Scale

Scales the region by the given factors.
region:Scale(scalex, scaley)
scalex
number
Horizontal scale factor (negative mirrors horizontally)
scaley
number
Vertical scale factor (negative mirrors vertically)
Example:
-- Scale to 150% size
region:Scale(1.5, 1.5)

Rotate

Rotates the texture by the specified angle.
region:Rotate(angle)
angle
number
Rotation angle in radians
Example:
-- Rotate 45 degrees
region:Rotate(math.rad(45))

GetRotation

Returns the current rotation angle.
local angle = region:GetRotation()
angle
number
Current rotation in radians

SetTexture

Changes the foreground texture (and background if sameTexture is enabled).
region:SetTexture(texture)
texture
string
Path to texture file
Example:
region:SetTexture("Interface\\Addons\\WeakAuras\\Media\\Textures\\Circle")

SetForegroundDesaturated

Converts foreground texture to grayscale.
region:SetForegroundDesaturated(desaturate)
desaturate
boolean
true for grayscale, false for full color

SetBackgroundDesaturated

Converts background texture to grayscale.
region:SetBackgroundDesaturated(desaturate)
desaturate
boolean
true for grayscale, false for full color

SetBackgroundColor

Sets the background texture color.
region:SetBackgroundColor(r, g, b, a)
r
number
Red color component (0-1)
g
number
Green color component (0-1)
b
number
Blue color component (0-1)
a
number
Alpha transparency (0-1)

SetRegionWidth

Sets the base width of the region.
region:SetRegionWidth(width)
width
number
Width in pixels

SetRegionHeight

Sets the base height of the region.
region:SetRegionHeight(height)
height
number
Height in pixels

SetInverse

Inverts the fill direction.
region:SetInverse(inverse)
inverse
boolean
true to invert fill direction

SetOrientation

Changes the progress orientation.
region:SetOrientation(orientation)
orientation
string
One of: HORIZONTAL, HORIZONTAL_INVERSE, VERTICAL, VERTICAL_INVERSE, CLOCKWISE, ANTICLOCKWISE

SetMirror

Mirrors the texture horizontally.
region:SetMirror(mirror)
mirror
boolean
true to mirror horizontally

SetOverlayColor

Sets the color of an overlay texture.
region:SetOverlayColor(id, r, g, b, a)
id
number
Overlay index
r
number
Red color component (0-1)
g
number
Green color component (0-1)
b
number
Blue color component (0-1)
a
number
Alpha transparency (0-1)

UpdateTime

Updates progress based on duration and expiration time.
region:UpdateTime()

UpdateValue

Updates progress based on value and total.
region:UpdateValue()

Update

Refreshes the entire region including texture and progress.
region:Update()

Texture Transformation

Progress textures support advanced transformation:

Crop Settings

Control how much of the texture is cropped:
data.crop_x = 0.41 -- Horizontal crop amount
data.crop_y = 0.41 -- Vertical crop amount
data.crop = 0.41   -- Crop amount for circular progress

Offset Settings

Shift the texture position:
data.user_x = 0 -- Horizontal offset (-1 to 1)
data.user_y = 0 -- Vertical offset (-1 to 1)

Rotation

Rotate the entire texture:
data.rotation = 0 -- Rotation in radians

Circular Progress

For circular/radial progress, configure start and end angles:
data.orientation = "CLOCKWISE"
data.startAngle = 0    -- Start at top (0-360)
data.endAngle = 360    -- Full circle (0-720)
Example - Half Circle:
data.startAngle = 0
data.endAngle = 180

Compress Mode

Compress mode scales the texture as it fills instead of revealing:
data.compress = true  -- Texture scales with progress
data.compress = false -- Texture is revealed by progress

Smooth Progress

Enable smooth progress transitions:
data.smoothProgress = true
When enabled, progress changes are animated smoothly using the SmoothStatusBar mixin.

Blend Modes

Control how textures blend with background:
data.blendMode = "BLEND"     -- Normal blending
data.blendMode = "ADD"       -- Additive blending
data.blendMode = "MOD"       -- Modulative blending
data.blendMode = "ALPHAKEY"  -- Alpha key blending

Properties

PropertyTypeSetterDescription
desaturateForegroundbooleanSetForegroundDesaturatedGrayscale foreground
desaturateBackgroundbooleanSetBackgroundDesaturatedGrayscale background
foregroundColorcolorColorForeground RGBA color
backgroundColorcolorSetBackgroundColorBackground RGBA color
widthnumberSetRegionWidthRegion width
heightnumberSetRegionHeightRegion height
orientationstringSetOrientationProgress direction
inversebooleanSetInverseInvert progress
mirrorbooleanSetMirrorHorizontal mirror

State Values

Reads these values from trigger state:
  • state.texture - Override texture path
  • state.value - Current value
  • state.total - Maximum value
  • state.duration - Time duration
  • state.expirationTime - End time
  • state.inverse - Invert progress
  • state.paused - Pause progress updates

Code Examples

Health Bar with Color Gradient

function()
  local region = aura_env.region
  local health = UnitHealth("player")
  local maxHealth = UnitHealthMax("player")
  local percent = health / maxHealth
  
  -- Set progress
  region:SetValueOnTexture(percent)
  
  -- Color gradient from red to green
  if percent > 0.5 then
    region:Color(0, 1, 0, 1)
  else
    region:Color(1, 1 - (percent * 2), 0, 1)
  end
end

Rotating Circular Progress

-- Setup circular progress
data.orientation = "CLOCKWISE"
data.startAngle = 0
data.endAngle = 360

-- Add rotation animation
function()
  local region = aura_env.region
  local time = GetTime()
  region:Rotate(time) -- Rotate based on time
end

Dynamic Texture Based on State

function()
  local region = aura_env.region
  local inCombat = UnitAffectingCombat("player")
  
  if inCombat then
    region:SetTexture("Interface\\Addons\\WeakAuras\\Media\\Textures\\Square_White")
    region:Color(1, 0, 0, 1)
  else
    region:SetTexture("Interface\\Addons\\WeakAuras\\Media\\Textures\\Circle")
    region:Color(0, 1, 0, 1)
  end
end

Inverse Fill on Low Value

function()
  local region = aura_env.region
  local value = region.state.value
  local total = region.state.total
  
  if value < total * 0.25 then
    region:SetInverse(true)
    region:Color(1, 0, 0, 1) -- Red when low
  else
    region:SetInverse(false)
    region:Color(1, 1, 1, 1) -- White when normal
  end
end

Build docs developers (and LLMs) love