TargetFrameHealthBarText

Hello everybody.

I want to change the text size of the Blizzard UI Player and Target frame.

Been trying to find a solution for good 2 hours now. My coding skill level is around “hello world” so I have to rely on code snippets I find online. I found some nifty little scripts to show the UI elements I’m trying to change, like:

/run print(GetMouseFocus():GetName())
and
/fstack

Anyways, I know how to change the player frame:

PlayerFrameHealthBarText:SetFont(“Fonts\ARIALN.ttf”, 13, “OUTLINE”)
PlayerFrameManaBarText:SetFont(“Fonts\ARIALN.ttf”, 13, “OUTLINE”)

My problem begins with the Target Frame.
/fstack spits out pretty much the same stuff I get when hovering over the Player Frame. So I tried this:

TargetFrameHealthBarText:SetFont(“Fonts\ARIALN.ttf”, 13, “OUTLINE”)
TargetFrameManaBarText:SetFont(“Fonts\ARIALN.ttf”, 13, “OUTLINE”)

Giving me some error is all it does. Why is it not working? What’s my mistake there? I’m playing Classic btw(no idea if that info is needed)

Can someone help me on this one? :slight_smile:

It seems like that frame can be accessed with TargetFrameHealthBar.TextString on Classic.

Now how to find this yourself? Use fstack and hover on the frame you need. Press alt until you see the child frame that you need highlighted. Check which frame name is selected with the arrow on the fstack tooltip. In this case it’s a dynamically created frame (child frame with some long random number), so that’s not going to be useful. Now press ctrl (you should still have your mouse in the same position as before you started pressing alt) and a table inspect window pops up. This lets you browse frame hierarchy. Now press the small up arrow in the top left to navigate to the parent frame. In this frame you can see childFrames named LeftText, RightText and TextString. The LeftText and RightText are used for if you have percentage and overall health enabled in the interface settings. The one we’re interested in is TextString. So you combine the name of the current frame (TargetFrameHealthBar, in the title bar of the inspect frame) with TextString and you end up with
TargetFrameHealthBar.TextString:SetFont(“Fonts\ARIALN.ttf”, 13, “OUTLINE”).

As a side note, the table inspect frame can also be opened with
/tinspect SomeFrame.

Thank you very much for your detailed answer :slight_smile:
Had some fun digging thru all the different frames via /tinspect

Unfortunately the solution you came up with is not working :frowning:

I compared the PlayerFrame to TargetFrame and i get different results as you can see here:

https: //imgur. com/a/OCwOTMx
(can’t even post pictures)

It’s something totally different from what I expected.

Your string is giving me a blank lua debug window lol. I tried some more variations like:

TargetFrameTextureFrame:SetFont(“Fonts\ARIALN.ttf”, 13, “OUTLINE”)
and
TargetFrameTextureFrame.TextString:SetFont(“Fonts\ARIALN.ttf”, 13, “OUTLINE”)

both are not working. Maybe it’s impossible to change because of the randomly generated stuff?

I had that issue with the blank lua debug window as well, and that was the result of copy pasting quotation marks from this post. Turns them into some open-quote close-quote version instead of generic quotes. I’m not sure I have the fonts to see any noticeable difference with your snippets so I just assumed they’d work like this.

ooh you’re right. I double checked the strings in notepad++. There were weird quotation marks in it. I corrected them and tried your string again. No error but nothing happend. No change. My experimental strings doesnt work either. Just errors.

So there’s no easy workaround for the dynamic frame problem, isnt it? :frowning:

EDIT:

I found the culprit :smiley:

There were a missing blackslash in your string. Not because you forgot one but because the Forum editor just did its weird magic. Your string is definitely working! :slight_smile:

TargetFrameHealthBar.TextString:SetFont(“Fonts\\ARIALN.ttf”, 13, “OUTLINE”)
TargetFrameManaBar.TextString:SetFont(“Fonts\\ARIALN.ttf”, 13, “OUTLINE”)

I had to type three \
The Forum editor stole one backslash. Blizzard please fix.

And thank you very much again, Ebear <3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.