Hello: first time posting here. so kinda hard to explain
coding left top unit frames
all works nicely except the text over health bar.
complete stuck there and with my lack on english i can't really find good info
hope u guys can help me with it
Code:
local health = CreateFrame("StatusBar",nil,self);
health:SetFrameStrata("BACKGROUND");
health:SetFrameLevel(2);
health:SetWidth(150);
health:SetHeight(30);
health:SetPoint("TOPLEFT",self.Castbar,"BOTTOMLEFT",0,-2);
health.value = health:CreateFontString(nil, "OVERLAY", "FontOutline10");
health.value:SetWidth(135);
health.value:SetHeight(11);
health.value:SetJustifyH("RIGHT");
health.value:SetJustifyV("MIDDLE");
health.value:SetPoint("LEFT",health,"LEFT",4,0);
self.Health = health;
self.Health.frequentUpdates = true;
self.Health.colorDisconnected = true;
self.Health.colorHealth = true;
healt.value:SetText("something%");
at the bottom is where i'm stuck
tryd the following, without luck
Code:
local min, max = UnitHealth(self.unit), UnitHealthMax(self.unit);
local gHealth = (min/max)*100;
health.value:SetText(gHealth);
also tryd including registerevents for unit health and maxhealth and with update and preupdate, finally considerd to post here.
thank you