View Single Post
05-30-17, 01:48 AM   #1
millanzarreta
A Deviate Faerie Dragon
 
millanzarreta's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 11
Question Modify HealthBar Width of specific Nameplates

Hi.

I like the default Blizz nameplates, but I have a lot of scripts to modify they a bit (color, font, hide some units, etc...), hooking functions like CompactUnitFrame_UpdateName, CompactUnitFrame_UpdateHealthColor, etc...

Now I'm trying to set certains nameplates smaller than other (pets/guardians smaller than normal nameplates). I can modify the height and the scale of a healthBar, but can't modify the width.

Example. If I run:

Lua Code:
  1. /run NamePlate1UnitFrame.healthBar:SetHeight(0.7*NamePlate1UnitFrame.healthBar:GetHeight())

That works. But this don't work:

Lua Code:
  1. /run NamePlate1UnitFrame.healthBar:SetWidth(0.7*NamePlate1UnitFrame.healthBar:GetWidth())

I also can do:

Lua Code:
  1. /run NamePlate1UnitFrame.healthBar:SetScale(0.7*NamePlate1UnitFrame.healthBar:GetScale())

But this only change the height scale, width remain unchanged.

I try modify the parent frame (NamePlate1UnitFrame) instead the healthBar (NamePlate1UnitFrame.healthBar), but with the same result, can change the height but can't change the width.

I only achieve to modify nameplates width with the function C_NamePlate.SetNamePlateEnemySize or modifying some CVars, but this affects to all enemy nameplates, and I'm looking to change width of specific nameplates.

I can modify almost everything of specific nameplates: modify the visibility, color, alpha, change the name text, move the elements, etc... but I don't know why I can't modify the width of healthBar nameplates.

Any suggestions?
  Reply With Quote