WoWInterface (
-   Lua/XML Help (
-   -   Create a single-line MessageFrame? (

Zax 09-29-19 05:19 AM

Create a single-line MessageFrame? (SOLVED)

I can't figure how to create a single-line MessageFrame, is order to display a string during a certain time, and then fade out.


local myMsgFrame = CreateFrame("MessageFrame", "myAddon_myMsgFrame", UIParent)
myMsgFrame:SetSize(200, 20)
myMsgFrame:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", 80, 200);
-------------- texture
local texture = myMsgFrame:CreateTexture(nil,"BACKGROUND")
texture:SetColorTexture(0, 0, 0, 0.6)
myMsgFrame.texture = texture
-------------- text
myMsgFrame.text = myMsgFrame:CreateFontString(nil, nil, "GameFontNormal")
myMsgFrame.text:SetPoint("topleft", 4, 1)
... ?

I would like to use it in my scripts with:

myMsgFrame:AddMessage(string, r, g, b, nil, holdTime)
Thank you.

Seerah 09-29-19 11:54 AM

I don't see you telling it which font to use.

Zax 09-29-19 12:41 PM

Oh, yes, I know several lines are missing. That's why I wrote a question mark, because I read some online documentations but didn't understand what commands should I use.

To precisely answer your question,

would be fine :)

SDPhantom 09-29-19 02:28 PM

You could use the existing UIErrorsFrame:AddExternalErrorMessage(message).

Zax 09-30-19 03:30 AM


Originally Posted by SDPhantom (Post 334046)
You could use the existing UIErrorsFrame:AddExternalErrorMessage(message).

Interesting to display errors, but I would like to display different kinds of texts, not only warnings (for example, something like "Data sent" or "Updated"...)

Zax 09-30-19 09:30 AM

OK, I just discovered API C_Timer.After, so I'm now able to erase a "standard" frame's text after duration.

All times are GMT -6. The time now is 02:55 AM.

vBulletin © 2021, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI