I am trying to get my broker display to properly display multiple icons with text mixed in. Here is what I have tried:
First I tried leaving width=0 which should make the icon the same size as the text but the icons seem considerably smaller than the text. On the plus side they stay lined up nicely though and don't seem to "climb".
Next I tried adding custom icon size and x/y offsets which makes the icon size controllable and they look better (to me) but if I add more icons and text they "climb" Seems like the text is attaching to the upper right of the icons instead of the center.
Using the y offset I can get the text and icons to line up but then they are higher on the display mod than other text (using dockingstation) So is there any way to change that attachment point or am I missing something?
Here is my function to update the broker text object:
local text = ""
for _, itemid in ipairs(db.sortedtext) do
if ItemInfo[itemid] then
local data = ItemInfo[itemid]
text = text .. "|T" .. data.icon
if db.customicon then text = text .. ":" .. db.texticonsize .. ":" .. db.texticonsize .. ":" .. db.iconx .. ":" .. db.icony .. "|t"
else text = text .. ":0|t" end
if data.count < data.max then color = "|c00FFFF00"
else color = "|c0000FF00" end
text = text .. color .. data.count .. "|r"
icons = true
if icons then
mod.obj.text = text
mod.obj.text = ""
Below is an excerpt from Blizzard's FrameXML/LFGFrame.lua:
local tankIcon = "|TInterface\\LFGFrame\\UI-LFG-ICON-PORTRAITROLES.blp:16:16:0:%d:64:64:0:19:22:41|t";
local healerIcon = "|TInterface\\LFGFrame\\UI-LFG-ICON-PORTRAITROLES.blp:16:16:0:%d:64:64:20:39:1:20|t";
local damageIcon = "|TInterface\\LFGFrame\\UI-LFG-ICON-PORTRAITROLES.blp:16:16:0:%d:64:64:20:39:22:41|t";
--[[ ... ]]
--Horrible hack to deal with a bug in embedded font strings. FIXME
--The more icons with absolute sizes in a certain fontstring, the higher up the text goes. This offsets it to make the icons be in line with the text.
local numRoles = (isTank and 1 or 0) + (isHealer and 1 or 0) + (isDamage and 1 or 0);
local yOffset = 2*(numRoles-1)-2; --Formula derived through testing.
local tankIcon = format(tankIcon, yOffset);
local healerIcon = format(healerIcon, yOffset);
local damageIcon = format(damageIcon, yOffset);
This hack really is horrible: sure text and icons are lined up, but then it's the whole thing that "climb". Unusable with LDB... Unless we push the hack further: adding a "fontstringOffsetY" attribute or something that display addons would use to relocate the fontstring on the frame/button. :p