WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Square Class Portraits (https://www.wowinterface.com/forums/showthread.php?t=46189)

10leej 04-06-13 03:27 PM

Square Class Portraits
 
Do we know if any exist in the default UI or do I have to make them?

Seerah 04-06-13 03:59 PM


https://github.com/Gethe/wow-ui-text...NS-CLASSES.PNG
Interface\WorldStateFrame\ICONS-CLASSES.blp

10leej 04-06-13 04:10 PM

Aw thank you, I didn't think to look there >.>

myrroddin 04-07-13 11:01 PM

Quote:

Originally Posted by Seerah (Post 275915)

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.

Nibelheim 04-07-13 11:25 PM

Quote:

Originally Posted by myrroddin (Post 276000)
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)

myrroddin 04-09-13 07:07 AM

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.

Ordrosh 04-09-13 08:03 AM

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

myrroddin 04-09-13 11:32 AM

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.

Nibelheim 04-09-13 11:56 AM

Quote:

Originally Posted by myrroddin (Post 276081)
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 :p All values are calculated from the Top Left corner. So for the Warrior icon it would be (0, 1/4, 0, 1/4)


zork 04-09-13 12:05 PM

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

Phanx 04-09-13 03:07 PM

Quote:

Originally Posted by myrroddin (Post 276081)
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.


All times are GMT -6. The time now is 03:18 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI