Create a StatusBar

Here's a quick way of creating a StatusBar that doesn't tile the texture. Positions it in the center of the UIParent.

Snippet

MyStatusBar = CreateFrame("StatusBar", nil, UIParent)
MyStatusBar:SetStatusBarTexture("Interface\\TargetingFrame\\UI-StatusBar")
MyStatusBar:GetStatusBarTexture():SetHorizTile(false)
MyStatusBar:SetMinMaxValues(0, 100)
MyStatusBar:SetValue(100)
MyStatusBar:SetWidth(200)
MyStatusBar:SetHeight(10)
MyStatusBar:SetPoint("CENTER",UIParent,"CENTER")
MyStatusBar:SetStatusBarColor(0,1,0)
Posted by Mikma at Sat, 26 Jun 2010 08:43:48 +0000