Thread Tools Display Modes
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
05-30-17, 04:35 AM   #2
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
No idea about setting width for specific nameplates, but the NamePlateHorizontalScale and NamePlateVerticalScale cvars could be useful

Originally Posted by millanzarreta View Post
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.

There seems to be only a difference between how enemy/friendly nameplates work, don't know if it would be possible to have pets/guardian nameplates different size
Kui_Nameplates can set the target nameplate scale differently by using :SetScale but you already said it only changes the height, not width :s

Last edited by Ketho : 05-30-17 at 04:38 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Modify HealthBar Width of specific Nameplates


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off