Status bar - WoWInterface
Thread Tools Display Modes
04-24-21, 12:39 AM   #1
A Kobold Labourer
Join Date: Mar 2021
Posts: 1
Status bar

Hi. I got the texture for status bar. it's circle shaped (like diablo 3 orbs), so I want to it to be vertical. what I meant by gif-like is I want the status bar to keep "rotating" indefinitely, like a gif image. I also want it to activate only for certain specs, specs that use mana as their primary resource (for example arcane mage, resto druid and holy priest, but NOT shadow priest, balance druid or other specs that use mana as their second resource). hope I explained myself clearly, I know it's a complicated but I tried my best. Thanks.

Last edited by Mag1cian : 07-09-21 at 07:29 AM.
  Reply With Quote
04-24-21, 04:47 AM   #2
nUI Maintainer
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,771
You have the rotation animation in the wow api but not sure if it will work while in combat.

This forum post discusses it when it first arrived onto the scene.

And this wowpedia page lists what is known about the Animation System - currently no real details

And this is a link to the latest wow api in case something in wow already does something similar to what you want so you can see how they did it.

Unless someone has played with animation enough to assist you may have to do the research yourself. Good Luck.
  Reply With Quote
04-24-21, 03:30 PM   #3
A Pyroguard Emberseer
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,233
The animation system rotates the entire UI object, not really something you want for a statusbar. What I've seen done is create a rotating texcoord set that adjusts its size to match whatever height adjustments you make to the bar.

Lua Code:
  1. local HalfSQRT2,LLAngle,LRAngle,UAngle=(2^0.5)/2,0.75*math.pi,0.25*math.pi,1.5*math.pi;
  2. local function Vector(x,y,angle,dist) return x+math.cos(angle)*dist,y+math.sin(angle)*dist; end
  3. local function CalcTexCoord(angle,percent)
  4.     local LLx,LLy=Vector(0.5,0.5,LLAngle+angle,HalfSQRT2);
  5.     local LRx,LRy=Vector(0.5,0.5,LRAngle+angle,HalfSQRT2);
  6.     local ULx,ULy=Vector(LLx,LLy,UAngle+angle,percent);
  7.     local URx,URy=Vector(LRx,LRy,UAngle+angle,percent);
  8.     return ULx,ULy,LLx,LLy,URx,URy,LRx,LRy;
  9. end
  11. local ManaFrame=CreateFrame("Frame",nil,UIParent);--    Container for mana orb texture
  12. ManaFrame:SetPoint("CENTER");
  13. ManaFrame:SetSize(256,256);
  15. local ManaOrb=ManaFrame:CreateTexture(nil,"ARTWORK");
  16. ManaOrb:SetTexture("Interface\\AddOns\\YourAddOn\\PathToFile");--   Set to whatever your texture is
  17. ManaOrb:SetPoint("BOTTOM");--   Attach to bottom of frame
  18. ManaOrb:SetSize(ManaFrame:GetSize());-- Init to frame size
  20. ManaFrame.PercentValue=1;-- Init
  21. ManaFrame:SetScript("OnUpdate",function(self) HealthOrb:SetTexCoord(CalcTexCoord((GetTime()%2)*math.pi,self.PercentValue)); end);
  23. ManaFrame.Unit="player";
  24. ManaFrame:RegisterUnitEvent("UNIT_DISPLAYPOWER",ManaFrame.Unit);
  25. ManaFrame:RegisterUnitEvent("UNIT_POWER_UPDATE",ManaFrame.Unit);
  26. ManaFrame:RegisterUnitEvent("UNIT_MAXPOWER",ManaFrame.Unit);
  27. ManaFrame:SetScript("OnEvent",function(self,event,...)
  28.     if select(2,UnitPowerType(self.Unit))=="MANA" then
  29.         local percent=UnitPower(self.Unit)/UnitPowerMax(self.Unit);
  30.         ManaOrb:SetHeight(self:GetHeight()*percent);--  Adjust texture height
  31.         ManaOrb.PercentValue=percent;-- Texcoord updates from OnUpdate script
  32.         self:Show();
  33.     else self:Hide(); end
  34. end);
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Status bar

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