View Single Post
03-19-24, 10:54 AM   #11
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,937
This has some examples and info on using it for sound
https://warcraft.wiki.gg/wiki/API_PlaySound

As to a colour alert, it depends on what you mean.

You could do something as simple as colourizing the text.
This can be done using hex code colouring when you set the text

eg |cAARRGGBBTextToDisplay|r

or for clarity and flexibility where ColorOn can be set to a different colour before setting the text.
Lua Code:
  1. local ColorOn = "|cAARRGGBB"
  2. local ColorOff = "|r"
  3. f.Text:SetText(ColorOn .. "Text to Display" .. ColorOff)

Or you could add a texture to the frame holding the text and colourise that according to your needs
More Info : https://warcraft.wiki.gg/wiki/API_Te...etColorTexture

Set the texture up at frame Creation time
Lua Code:
  1. f.Color = f:CreateTexture(nil,"BACKGROUND") - Set to Background so that the text appears above it
  2. f.Color:SetAllPoints()

Then, when you need to change it's color use this line
Lua Code:
  1. f.Color:SetColorTexture(r, g, b, a) - Where r,g,b and a are values between 0 and 1.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote