Thread Tools Display Modes
10-30-15, 02:12 PM   #1
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
texture:SetAtlas() and using cooldown swipe texture for rings.



Interesting is this part:
Lua Code:
  1. if (rank > 1) then
  2.         self.BuildingPulse:SetAtlas("Garr_BuildingUpgradeExplosion", true);
  3.         self.AlphaPulse:SetAtlas("Garr_BuildingUpgradeExplosion", true);
  4.         self.Timer.BG:SetAtlas("Garr_UpgradeIconTimerBG", true);
  5.         self.Timer.CompleteRing:SetAtlas("Garr_UpgradeIconTimerFill", true);
  6.         self.Timer.Cooldown:SetSwipeTexture("Interface\\Garrison\\Garr_TimerFill-Upgrade");
  7.     else
  8.         self.BuildingPulse:SetAtlas("Garr_BuildingPlacementExplosion", true);
  9.         self.AlphaPulse:SetAtlas("Garr_BuildingPlacementExplosion", true);
  10.         self.Timer.BG:SetAtlas("Garr_BuildingIconTimerBG", true);
  11.         self.Timer.CompleteRing:SetAtlas("Garr_BuildingIconTimerFill", true);
  12.         self.Timer.Cooldown:SetSwipeTexture("Interface\\Garrison\\Garr_TimerFill");
  13.     end
https://github.com/tekkub/wow-ui-sou...ngUI.lua#L1626

So basically I had another idea for the ring stuff. Now that we have swipe textures we might just fake a ring by just implementing a cooldown frame with a ring swipe texture.

Additionally I found a lot of texture:SetAltlas(textureFile, true) calls. What is that?

http://wowprogramming.com/docs/widgets/Texture/SetAtlas
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
10-30-15, 02:20 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,891
Not overly informative but a start, from the 6.0.2 change list.

New "atlas" and "useAtlasSize" properties for textures defined in XML. Equivalent function added for texture widgets called Texture:SetAtlas. For example:

Before: file="Interface\PetBattles\PetJournal"
After: atlas="PetJournal-BattleSlot-Locked" useAtlasSize="true"
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
10-30-15, 02:32 PM   #3
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
The only problem with using cooldown frames for this is that addons that hook the metatable to display time left (like omnicc) might end up drawing on your ring.

Atlases are basically hardcoded texture coordinates blizzard added so instead of having SetTexCoords all over the place they could use the name of the atlas, and if they need to update the coordinates for the texture they only need to do it in one place.
  Reply With Quote
10-30-15, 03:16 PM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,891
Originally Posted by semlar View Post
Atlases are basically hardcoded texture coordinates blizzard added so instead of having SetTexCoords all over the place they could use the name of the atlas, and if they need to update the coordinates for the texture they only need to do it in one place.
Next question would be, do you know where/how they are defined? A search for Garr_UpgradeIconTimerBG only turned up the one SetAtlas() instance.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
10-30-15, 05:16 PM   #5
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Originally Posted by Fizzlemizz View Post
Next question would be, do you know where/how they are defined? A search for Garr_UpgradeIconTimerBG only turned up the one SetAtlas() instance.
They're defined internally (not sure if there's a DBC file for it), and you can't create your own atlases, only reference the existing ones.
  Reply With Quote
10-30-15, 06:21 PM   #6
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,891
Originally Posted by semlar View Post
They're defined internally (not sure if there's a DBC file for it), and you can't create your own atlases, only reference the existing ones.
Well, that puts paid to that idea .

Thank you.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
10-31-15, 10:47 AM   #7
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Yeah would be funny if OmniCC would add numbers to the rings. But there are attributes for that I guess.
Thanks for the info on the atlas.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

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

WoWInterface » Developer Discussions » Lua/XML Help » texture:SetAtlas() and using cooldown swipe texture for rings.


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