Quantcast WoWInterface - View Single Post - Guild Tabard Icon
View Single Post
04-13-11, 11:07 AM   #4
A Molten Giant
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 846
Originally Posted by frohanss View Post
Basicly whant to overlay the icon on top of another frame.
I worked a bit with it, for one of my (Ace3) addons. As to "to overlaying the icon on top of another frame", I don't have any experience with anything other than UI escape sequences (which I used in Ace3 options tables)
  • This example function returns the (UI escape sequence) icon for the current Guild Emblem with a size of 32px, or "Interface\\GuildFrame\\GuildLogo-NoLogo" if not in a guild.
  • It only returns the no-background/uncolored/unbordered texture.
  • I've looked into the FrameXML, and I want to say that Blizzard uses the Guild Emblem in a lot of different places (e.g. Guild Invites/Guild Bank/Guild Achievements/Micro Menu), both in Lua and XML
function MyAddOn:GuildEmblem()
	-- table lookup shortcut*
	local char = self.db.char
	-- check if Blizzard_GuildUI is loaded
	if GuildFrameTabardEmblem then
		char.guildTexCoord = {GuildFrameTabardEmblem:GetTexCoord()}
	if IsInGuild() and char.guildTexCoord then
		return "|TInterface\\GuildFrame\\GuildEmblemsLG_01:32:32:0:0:32:32:"..(char.guildTexCoord[1]*32)..":"..(char.guildTexCoord[7]*32)..":"..(char.guildTexCoord[2]*32)..":"..(char.guildTexCoord[8]*32).."|t"
		return "|TInterface\\GuildFrame\\GuildLogo-NoLogo:32:32|t"
*The example's table lookup shortcut should get "refreshed" in some other (Ace3) code on "Ace3 Profile changes", but that is unrelated with the thread

"Interface\\GuildFrame\\GuildEmblemsLG_01" is the .BLP used for in the Guild frame

In addition to Nibelheim I've found another function that might help:
local bkgR, bkgG, bkgB, borderR, borderG, borderB, emblemR, emblemG, emblemB, emblemFilename = GetGuildLogoInfo()
Originally Posted by frohanss View Post
Thx Nibelheim.
That is about all i also have found.
Atm im a expert nab, so starting to fish around that code will be painfull work. So hope some real expert can help more around this.
Myself I would really just suggest to start digging in there and see for yourself how Blizzard is implementing the Guild Emblem. What I posted is really just some ugly way to get the text coords straight from the GuildFrameTabardEmblem. But someone else will definitely know how it works, complete with background, borders, and colors =)

Last edited by Ketho : 04-13-11 at 11:29 AM.
  Reply With Quote