View Single Post
10-23-22, 08:20 PM   #3
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 341
What you actually want to do is to create a mask texture that follows the outline of the health bar shape you want and then apply it to the status bar texture of your health bar.

Lua Code:
  1. local mask = Health:CreateMaskTexture()
  2. mask:SetTexture("path\\to\\your\\mask", "CLAMPTOBLACKADDITIVE", "CLAMPTOBLACKADDITIVE")
  3. mask:SetPoint("TOPLEFT", Health, "TOPLEFT", 0, 0)
  4. mask:SetPoint("BOTTOMRIGHT", Health, "BOTTOMRIGHT", 0, 0)
  5.  
  6. health:GetStatusBarTexture():AddMaskTexture(mask)

For instance, that's my old odd shaped unitframe (rip "round" layout ):


And here's the mask I used for its health bar:
__________________

Last edited by p3lim : 10-24-22 at 07:12 PM.
  Reply With Quote