View Single Post
07-17-15, 12:02 PM   #9
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 341
Here's an example of a simplified lua implementation w/o xml-templates. A simple statusbar constructor, based on existing functions from StatusBar.lua.

Ofc you'll have to add some other code, cuz I dun intend to write everything for ya

Lua Code:
  1. local function CreateAnimatedStatusBar(parent, ...)
  2.     local bar = CreateFrame("StatusBar", "$parentStatusBar", parent)
  3.  
  4.     local fill = bar:CreateTexture(nil, "ARTWORK")
  5.     fill:SettAllPoints(bar:GetStatusBarTexture())
  6.     fill:SetTexture("Interface\\AddOns\\SyncUI\\Media\\Textures\\Elements\\Statusbar\\StatusBar_Animated_Fluid")
  7.     bar.Fill = fill
  8.  
  9.     tinsert(framesToAnimate, bar)
  10.  
  11.     return bar
  12. end
  13.  
  14. local AnimationController = CreateFrame("Frame")
  15. AnimationController:SetScript("OnUpdate", SyncUI_AnimatedStatusBarFrame_OnUpdate)

Then you spawn statusbars like so:
Lua Code:
  1. local healthbar = CreateAnimatedStatusBar(your_unit_frame)
__________________

Last edited by lightspark : 07-17-15 at 12:05 PM.
  Reply With Quote