View Single Post
04-09-13, 03:07 PM   #11
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by myrroddin View Post
If I wanted the Warrior icon, I'd use 0/4, 1/4, 0, 3/4 correct? Or at least nearly enough that I could figure it out once I plug it into code.
Values are normalized from 0 to 1. 0 is either the left edge, or the top edge. 1 is the right edge or bottom edge. 0.5 is right in the middle, 0.25 is closer to the left or top, 0.9 is close to the right or bottom.

For example, to trim the beveled edges off Blizzard icons, you'll see a lot of icon:SetTexCoord(0.07, 0.93, 0.07, 0.93) in addons.

You don't have to use fractions (you'll see values like 0.64189753247 in Blizzard code) but it tends to be easier to write 18/64 or something than to calculate the decimal value yourself and write it all in.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote