I'm making health text for a
HUD addon I'm working on I got the bars updating I just gotta work on the text that I've honestly never dealth with before.
Then if I want the numbers to run and update with health changes I can just do this?
Lua Code:
f.HealthText = f:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
f.HealthText:SetPoint("BOTTOM",f.hp,0,0)
local currentHealth, maxHealth = UnitHealth("player"), UnitHealthMax("player")
local function update(self)
local unit = self.unit
f.PowerText:SetFormattedText("%d/%d", currentPower, maxPower)
f:SetScript("OnEvent",update)
f:RegisterUnitEvent("UNIT_HEALTH",f.unit)
update(f) --initial update