default_chat_frame:AddMessage and icons?

So I was hoping to be able to use the raid icons in some of my addon messages. But they don’t seem to work. I can get colour coded messages working just fine.

msg = "|T{rt8}0|t SCARY";
DEFAULT_CHAT_FRAME:AddMessage(msg, r, g, b);

Just prints “SCARY”. I also tried without the escape codes and it print “{rt8} SCARY”.

So I’m wondering whether the default_chat_frame just flat out won’t work with icons? I couldn’t find anything that explicitly states it one way or the other.

DEFAULT_CHAT_FRAME:AddMessage(ICON_LIST[8].."0\124t \124cffff0000SCARY!!!\124r")

Edit: The convention seems to be to use a zero before the texture termination token.

Thanks as always for the prompt and helpful information :slight_smile:
Interesting that {rt8} or {skull} don’t work and you need to use ICON_LIST[8] as well.

Looking at this ICON_LIST[8] is just a global value that points to “Interface\TargetingFrame\UI-RaidTargetIcon_8”, does that mean you can put essentially any texture in? Including your own?

Indeed, See:

The CreateTextureMarkup utiltiy function makes it pretty easy eg.
frame.FontString:SetText(CreateTextureMarkup("Interface/Addons/SomeAddon/Textures/SomeTexture", 64, 64, 16, 16, 0, 1, 0, 1))

I could have sworn I read that page but didn’t see that information. I think I need to stop coding at 4am.

Thanks again