Thread Tools Display Modes
07-15-12, 01:18 AM   #1
Gregity
A Wyrmkin Dreamwalker
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 54
How to color the border of a frame?

Just the border, not the entire frame.

Code:
panel:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background", 
                   edgeFile = "Interface/BUTTONS/UI-SliderBar-Border.png",
                   edgeSize = 4, 
                   insets = { left = 1, right = 1, top = 1, bottom = 1 }
                   })
I'd like to turn the UI-SliderBar-Border golden, not grey.

How do I do this without making the background golden?

Do I need two frames, one with no bgfile that gets colored, and one that is only the edgefile?

-g
  Reply With Quote
07-15-12, 01:29 AM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,917
You would simply use the following statements.

frame:SetBackdrop(bd);
frame:SetBackdropColor(bg.red,bg.green,bg.blue, bg.alpha);
frame:SetBackdropBorderColor(bc.red, bc.green,bc.blue, bc.alpha);

where bd is the backdrop table you listed, bg is a table of red,green,blue,alpha values and bc another table of red,green,blue,alpha values.

Hope that helps you.
__________________
  Reply With Quote
07-15-12, 04:30 AM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
You do not need to construct a table to use SetBackdropColor or SetBackdropBorderColor. If you do not already have a table (eg. in your addon's SavedVariables) you should not waste memory constructing a table just to look up the values and pass them separately; just pass the values you want.

Also FYI, those functions are listed right next to SetBackdrop on the Widget API list on Wowpedia. If you're working with frames and aren't familiar with all of the functions, that's probably a good page to bookmark and check often.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
07-15-12, 04:50 AM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,917
True that Phanx.

Sorry, the code I posted was part of my addon where by the color table was a part of the options table I use. Of course you can directly set the color portions.
__________________
  Reply With Quote
07-17-12, 07:23 PM   #5
Gregity
A Wyrmkin Dreamwalker
AddOn Author - Click to view addons
Join Date: Oct 2007
Posts: 54
If it had been a snake, I'd be bitten...

Thank you both!

I'm hunting all around trying find things. I had seen the background ones, I just missed the border one. Google wasn't helping so I knew the folks here would be able to tell me.

-g
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » How to color the border of a frame?

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