Thread Tools Display Modes
09-29-19, 05:19 AM   #1
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 147
Create a single-line MessageFrame? (SOLVED)

Hello,

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.

Code:
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:SetAllPoints(true)
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:
Code:
myMsgFrame:AddMessage(string, r, g, b, nil, holdTime)
Thank you.

Last edited by Zax : 09-30-19 at 09:31 AM.
  Reply With Quote
09-29-19, 11:54 AM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
I don't see you telling it which font to use.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
09-29-19, 12:41 PM   #3
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 147
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,
Code:
"Fonts\\FRIZQT__.TTF", 11, "OUTLINE, MONOCHROME"
would be fine
  Reply With Quote
09-29-19, 02:28 PM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
You could use the existing UIErrorsFrame:AddExternalErrorMessage(message).
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
09-30-19, 03:30 AM   #5
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 147
Originally Posted by SDPhantom View Post
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"...)

Last edited by Zax : 09-30-19 at 06:52 AM.
  Reply With Quote
09-30-19, 09:30 AM   #6
Zax
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 147
OK, I just discovered API C_Timer.After, so I'm now able to erase a "standard" frame's text after duration.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Create a single-line MessageFrame?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off