Thread Tools Display Modes
04-18-24, 03:24 PM   #1
Macblack13
A Kobold Labourer
Join Date: Apr 2024
Posts: 1
how to change healthBar width?

I'm trying to make NamePlate1.UnitFrame.healthBar.background:SetSize(100, 6) but only the height changes, the width doesn't change even if I use SetWidth, how can I change the width?
  Reply With Quote
04-19-24, 04:12 PM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,336
If it has more than one anchor set, it might be locked to the size of its parent. If you run :ClearAllPoints(), it'll wipe them out. You'll then need to redefine at least one anchor with :SetPoint() so the game knows where to render it on screen.

For example:
Lua Code:
  1. NamePlate1.UnitFrame.healthBar.background:ClearAllPoints();
  2. NamePlate1.UnitFrame.healthBar.background:SetPoint("CENTER");
  3. NamePlate1.UnitFrame.healthBar.background:SetSize(100,6);
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
04-19-24, 06:10 PM   #3
sirpucna
An Aku'mai Servant
Join Date: Nov 2016
Posts: 34
i've tried this in the past with success
Lua Code:
  1. C_CVar.SetCVar("NamePlateHorizontalScale", 2)
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » how to change healthBar width?

Thread Tools
Display Modes

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