View Single Post
09-17-22, 02:15 PM   #1
doofus
A Chromatic Dragonspawn
Join Date: Feb 2018
Posts: 158
Display near focus frame

I have an addon which wants to display something, for example "hello". I am doing this with some code I found about like this:

fNoticeBoard = CreateFrame("Frame", "DA_NoticeBoard", UIParent);
--17.3" 4K monitor
fNoticeBoard:SetPoint("CENTER",-333,-400);
fNoticeBoard:SetWidth(1);
fNoticeBoard:SetHeight(1);
fNoticeBoard:Show();
fNoticeBoard.text = fNoticeBoard:CreateFontString(nil, "OVERLAY");
fNoticeBoard.text:SetFont("Fonts\\FRIZQT__.TTF", 18, "OUTLINE, MONOCHROME");
fNoticeBoard.text:SetPoint("LEFT", fNoticeBoard);


and to display something:

fNoticeBoard.text:SetText("Hello world");


Now, I want to be able to position this "frame" (or whatever the name is) near the focus frame, wherever the focus frame happens to be. If there is no focus frame, then of course display nothing.

Can someone please let me know how to do this?

Alternatively: allow the player to alt-shift-whatever click and drag the "Hello world" wherever they want, that will be even better. But I guess more complicated.
  Reply With Quote