Thread Tools Display Modes
04-06-13, 03:27 PM   #1
10leej
A Molten Giant
 
10leej's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2011
Posts: 583
Square Class Portraits

Do we know if any exist in the default UI or do I have to make them?
__________________
Tweets YouTube Website
  Reply With Quote
04-06-13, 03:59 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860

https://github.com/Gethe/wow-ui-text...NS-CLASSES.PNG
Interface\WorldStateFrame\ICONS-CLASSES.blp
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
04-06-13, 04:10 PM   #3
10leej
A Molten Giant
 
10leej's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2011
Posts: 583
Aw thank you, I didn't think to look there >.>
__________________
Tweets YouTube Website
  Reply With Quote
04-07-13, 11:01 PM   #4
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Originally Posted by Seerah View Post

https://github.com/Gethe/wow-ui-text...NS-CLASSES.PNG
Interface\WorldStateFrame\ICONS-CLASSES.blp
I've never looked before, and now I'm wondering: if you wanted one or two (or less than all) the class icons, how would you pull them? ICONS_CLASSES.PNG is one image.
  Reply With Quote
04-07-13, 11:25 PM   #5
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
Originally Posted by myrroddin View Post
I've never looked before, and now I'm wondering: if you wanted one or two (or less than all) the class icons, how would you pull them? ICONS_CLASSES.PNG is one image.
Lua Code:
  1. Texture:SetTexCoord(left, right, top, bottom)

i.e: To get the Shaman icon, you'd do:
Lua Code:
  1. MyTexture:SetTexCoord(1/4, 2/4, 1/4, 2/4)
  Reply With Quote
04-09-13, 07:07 AM   #6
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Thank you. Now if you would be so kind to explain what the numbers mean based on the graphic? Meaning the Shaman works out to something like
  1. "One column in from left"
  2. "Two columns in from right"
  3. "One row down from top"
  4. "Two rows up from bottom"
Which doesn't quite work.
  Reply With Quote
04-09-13, 08:03 AM   #7
Ordrosh
A Theradrim Guardian
Join Date: Sep 2008
Posts: 69
from the looks of the posted graphics its been created with 4 rows of 4 icons in it, which does make things easier calculation wise
upper left point of the rectangle surronding the shaman icon is then 1/4 of width and height into the image
lower right point 1/2 the width and height into the image or to stick with fours 2/4
normally origin for coords like this would be the upper left corner of the complete image
  Reply With Quote
04-09-13, 11:32 AM   #8
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Bottom row is empty... of course! Thank you Ordrosh and Nibelheim This was bothering me when I was looking at the minimap icons and saw one giant image, and then someone asked about the class icons, which works on the same principle.

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.
  Reply With Quote
04-09-13, 11:56 AM   #9
Nibelheim
local roygbi-
 
Nibelheim's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 1,600
Originally Posted by myrroddin View Post
Bottom row is empty... of course! Thank you Ordrosh and Nibelheim This was bothering me when I was looking at the minimap icons and saw one giant image, and then someone asked about the class icons, which works on the same principle.

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.
Sorry, it's really early here and I screwed up my last image All values are calculated from the Top Left corner. So for the Warrior icon it would be (0, 1/4, 0, 1/4)

  Reply With Quote
04-09-13, 12:05 PM   #10
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Here is the corresponding string icon code.

I set the icon size to 14. Could be any size.

Lua Code:
  1. --classes
  2.   --warrior
  3.   tinsert(icons, "|TInterface\\WorldStateFrame\\ICONS-CLASSES:14:14:0:0:256:256:0:64:0:64|t")
  4.   --mage
  5.   tinsert(icons, "|TInterface\\WorldStateFrame\\ICONS-CLASSES:14:14:0:0:256:256:64:128:0:64|t")
  6.   --rogue
  7.   tinsert(icons, "|TInterface\\WorldStateFrame\\ICONS-CLASSES:14:14:0:0:256:256:128:196:0:64|t")
  8.   --druid
  9.   tinsert(icons, "|TInterface\\WorldStateFrame\\ICONS-CLASSES:14:14:0:0:256:256:196:256:0:64|t")
  10.   --hunter
  11.   tinsert(icons, "|TInterface\\WorldStateFrame\\ICONS-CLASSES:14:14:0:0:256:256:0:64:64:128|t")
  12.   --shaman
  13.   tinsert(icons, "|TInterface\\WorldStateFrame\\ICONS-CLASSES:14:14:0:0:256:256:64:128:64:128|t")
  14.   --priest
  15.   tinsert(icons, "|TInterface\\WorldStateFrame\\ICONS-CLASSES:14:14:0:0:256:256:128:196:64:128|t")
  16.   --warlock
  17.   tinsert(icons, "|TInterface\\WorldStateFrame\\ICONS-CLASSES:14:14:0:0:256:256:196:256:64:128|t")
  18.   --paladin
  19.   tinsert(icons, "|TInterface\\WorldStateFrame\\ICONS-CLASSES:14:14:0:0:256:256:0:64:128:196|t")
  20.   --deathknight
  21.   tinsert(icons, "|TInterface\\WorldStateFrame\\ICONS-CLASSES:14:14:0:0:256:256:64:128:128:196|t")
  22.   --monk
  23.   tinsert(icons, "|TInterface\\WorldStateFrame\\ICONS-CLASSES:14:14:0:0:256:256:128:196:128:196|t")

Result:


The full icon archive:
http://www.wowinterface.com/forums/s...ad.php?t=46221
__________________
| 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 : 04-09-13 at 12:10 PM.
  Reply With Quote
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

WoWInterface » Developer Discussions » General Authoring Discussion » Square Class Portraits

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