Thread Tools Display Modes
08-20-09, 09:39 AM   #1
Vargulmer
A Murloc Raider
 
Vargulmer's Avatar
Join Date: Mar 2007
Posts: 8
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.
__________________
Vargulmer
LvL 100Dwarf Priest (Shadow)
  Reply With Quote
08-20-09, 09:57 AM   #2
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
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")
__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.
This is your permission slip.

If you need to contact me, do so on Twitter @v6ooo

Best regards, v6.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » StatusBars in LUA only???

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off