Originally Posted by lynce
Yes i have looked at it. But what i do not understand is how he uses this to represent his bars in the unitframes. Like where in the code
|
StatusBar.xml? Syncrow utilises xml-templates... Read code there...
He has a .Fill texture, that is used for animation, this particular texture is attached to statusbar texture. It's all written in the code there, please, read more carefully :3
Lua Code:
function SyncUI_AnimatedStatusBar_OnLoad(self)
table.insert(framesToAnimate,self)
self.Fill:SetAllPoints(self:GetStatusBarTexture())
end
Code:
<StatusBar name="SyncUI_AnimatedStatusBarTemplate" virtual="true">
<Layers>
<Layer level="BACKGROUND">
<Texture file="Interface\AddOns\SyncUI\Media\Textures\Elements\Statusbar\StatusBar_Background" />
</Layer>
<Layer level="ARTWORK">
<Texture parentKey="Fill" setAllPoints="true" file="Interface\AddOns\SyncUI\Media\Textures\Elements\Statusbar\StatusBar_Animated_Fluid" />
</Layer>
</Layers>
<Scripts>
<OnLoad function="SyncUI_AnimatedStatusBar_OnLoad" />
</Scripts>
<BarTexture />
</StatusBar>
He then creates a status bar, using template and thus inherits all options:
Code:
<StatusBar parentKey="HealthBar" name="$parentHealthBar" inherits="SyncUI_AnimatedStatusBarTemplate" useParentLevel="true" minValue="0" maxValue="100">
<Size x="74" y="34"/>
<Anchors>
<Anchor point="TOPLEFT" x="5" y="-5"/>
</Anchors>
</StatusBar>
Same can be done in pure lua or mixture of lua and xml.