WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   StatusBars in LUA only??? (https://www.wowinterface.com/forums/showthread.php?t=26658)

Vargulmer 08-20-09 09:39 AM

StatusBars in LUA only???
 
Hey guys, I've spent the past week searching to see if there was a way to create statusbars in just LUA without having todo XML coding.
I know its possible to create frames using JUST LUA, I do it all the time. So far after about 300 attempts I'm still perplexed as to if its even possible to do a status bar without coding the XML to do it.

Please don't just post links to the Wowiki site, I've been through all of that and haven't found anything that worked for me.

Thanks in advance.

Oh, I guess I should mention the reason behind what I"m trying to do is that I'm attempting to make unitframes in LitePanels mod. Specifically Player and Target Only.
I'm pretty good with lua and UTF-8. Just not very good at XML.

v6o 08-20-09 09:57 AM

Code:

CreateFrame("StatusBar")
http://www.wowwiki.com/Widget_API#StatusBar

You'd still have to set width, height, color, min/max values and whatnot. Register events for health or mana and whatever you'd need to update your statusbar.

e.g

Code:

NameOfStatusBar:SetScript("OnEvent", function(self, event, unit)
  if event=="UNIT_HEALTH" and unit=="player" then
    NameOfStatusBar:SetValue(UnitHealth("player"))
  end
end)
NameOfStatusBar:RegisterEvent("UNIT_HEALTH")



All times are GMT -6. The time now is 11:20 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI