Thread Tools Display Modes
08-20-16, 10:11 PM   #1
Sweetsour
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Dec 2014
Posts: 130
Status Bar Texture Distortion (Solved)

I'm getting an odd issue with a vertical status bar I'm working on. When I test out its appearance and not running, the texture is fine, but when the status bar is running, the texture is completely distorted.

This is when the bar is not running.


This is when the bar is running.


This is my code:
Lua Code:
  1. local BackdropSB = {
  2.     bgFile   = "Interface\\Tooltips\\UI-Tooltip-Background",
  3.     edgeFile = nil,
  4.     tile = true,
  5.     tileSize = 16
  6. }
  7.  
  8. -- Earth Elemental Duration Status Bar
  9. local EarthElementalBar = CreateFrame("StatusBar","EarthElementalBar",EarthElementalBG);
  10. EarthElementalBar:SetOrientation("VERTICAL");
  11. EarthElementalBar:SetStatusBarTexture("Interface\\addons\\ShamanAuras\\media\\statusbar\\Glamour5.tga");
  12. EarthElementalBar:GetStatusBarTexture():SetHorizTile(false);
  13. EarthElementalBar:GetStatusBarTexture():SetVertTile(false);
  14. EarthElementalBar:SetWidth(17);
  15. EarthElementalBar:SetHeight(175);
  16. EarthElementalBar:SetFrameStrata("LOW");
  17. EarthElementalBar:SetPoint("CENTER",UIParent,"CENTER",0,0);
  18. EarthElementalBar:SetStatusBarColor(0.84,0.65,0.51);
  19.  
  20. EarthElementalBar.bg = EarthElementalBar:CreateTexture(nil,"BACKGROUND");
  21. EarthElementalBar.bg:SetTexture("Interface\\TargetingFrame\\UI-StatusBar");
  22. EarthElementalBar.bg:SetAllPoints(true);
  23. EarthElementalBar.bg:SetVertexColor(0,0,0);
  24.  
  25. EarthElementalBar:SetMinMaxValues(0,15);
  26.  
  27. -- Code when bar is running
  28. SSA.EarthElementalBar:SetScript("OnUpdate",function(self,elapsed)
  29. local expires = startTime + 15;
  30. local remaining = parseTime((expires - GetTime()),true);
  31.  
  32.     if ((tonumber(remaining) or 0) > 0) then
  33.         self.text:SetText(remaining);
  34.         self:SetValue(tonumber(remaining));
  35.     else
  36.         self:SetScript("OnUpdate",nil);
  37.     end
  38. end);

Thanks for any help!

Last edited by Sweetsour : 08-21-16 at 12:18 AM.
  Reply With Quote
08-21-16, 12:10 AM   #2
Sweetsour
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Dec 2014
Posts: 130
After further investigation, it looks like the texture isn't rotating when the status bar is running. Not sure why that is

EDIT: Phew, after many hours of googling and digging, I found the answer:

Code:
statusbar:SetRotatesTexture(true)

Last edited by Sweetsour : 08-21-16 at 12:16 AM.
  Reply With Quote
08-21-16, 01:35 AM   #3
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Thanks for pointing that out.

I checked how I did it in oUF_Diablo for WoW 6.0. The player orbs I used vertical statusbar textures.
https://github.com/zorker/rothui/blo...layer.lua#L264

Setting statusbar:SetOrientation("VERTICAL") was enough to get it right. At least for Warlords of Draenor.

But maybe the premise is different. The orb textures are square and I do not need to use
Texture:SetHorizTile()
Texture:SetVertTile()
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 08-21-16 at 01:42 AM.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Status Bar Texture Distortion


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