I was trying to create a Name text which colors name with raidcolor while level is not and here's how I've done it.
Lua Code:
A.CreateNameText = function(f, unit)
local Name = f.Health:CreateFontString("$parentName", "OVERLAY");
Name:SetFont(NAME_FONT, 12, "OUTLINE");
if unit == "player" then
Name:SetPoint("BOTTOMLEFT", f.Health, "TOPLEFT", 0, 2);
f:Tag(Name, "[level] [raidcolor][name]|r");
elseif unit == "target" then
Name:SetPoint("BOTTOMRIGHT", f.Health, "TOPRIGHT", 0, 2);
f:Tag(Name, "[raidcolor][name]|r [level][plus]");
elseif unit == "targettarget" then
Name:SetPoint("CENTER", f.Health, "CENTER");
f:Tag(Name, "[raidcolor][name]|r");
end
end
I have added
|r at the end of
[name] tag in order to prevent the next texts being effected by
[raidcolor] tag.
This seems to be working, but I am not sure whether there is another possible built in solution for this within oUF.
(I had a look at Tag.lua file and failed to find something that is related to this...
)