I'm working on my own unit frames.
I want to show a tooltip for the buff at index 1 when I mouse over my frame. I am not seeing anything, however.
Wrote up a simple example to see what i'm doing.
Code:
local f = CreateFrame("Frame", "TestFrame", UIParent)
f:SetWidth(100)
f:SetHeight(100)
f:SetPoint("CENTER")
f.texture = f:CreateTexture("Texture", "Background")
f.texture:SetColorTexture(0.03, 0.03, 0.03, 0.8)
f.texture:SetAllPoints(f)
local tt = CreateFrame("GameTooltip", "MyTooltip", UIParent, "GameTooltipTemplate")
tt:SetOwner(f, "ANCHOR_RIGHT")
tt:Hide()
f:SetScript("OnEnter", function()
if (UnitBuff("player", 1)) then
tt:SetUnitBuff("player", 1)
tt:Show()
end
end)