View Single Post
02-27-24, 09:33 AM   #51
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,894
Correct,

Lua Code:
  1. local Pets = someframe:CreateFontString(nil, somedrawlayer, somefont)

Replace someframe with the frame you want to be the parent of the new FontString
The parent will effect the Fonstrings scale and when it's, shown/hidden etc.

Replace somedrawlayer and somefont with the relevent information depending on where in the layer stack you want the string displayed and the font/size you want the text to be displayed in. See the docs for CreateFontString and see this page for some of the in-game fonts configurations ie. GameFontNormal, GameFontHighlight etc. etc. etc.

You can't use someframe (whichever that frame is) to create the FontString until after the frame itself has been created (The order that code is placed (runs) matters).
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 02-27-24 at 10:07 AM.
  Reply With Quote