Thread Tools Display Modes
Prev Previous Post   Next Post Next
10-25-10, 11:35 PM   #1
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
How to handle SetBackdrop and do 1px stuff in just one call

Made a tutorial addon to let you experiment with settings.

http://www.wowinterface.com/download...tBackdrop.html

SetBackdrop allows
- glows/shadow
- inner glow/inner shadow
- border
- background

If you trick with the texture color and alpha layer you can even combine three effect at once.

Example

Flat texture:


The alpha layer:


Result:


So you get 3 effects at once. 1px outer shadow, 1px inner shadow and 1px border. Plus you can even change that white area to any color you want with SetBackdropBorderColor(r,g,b,a).

Additinally a texture to show how the borders are aligned:


It is LEFT, RIGHT, TOP, BOTTOM

Your texture need to keep the width/height ratio of 8:1, otherwise it will not work.

To get no anti-aliasing: If you are using a edge texture with 16px height your edgeSize must be 16 to get no scaling. If you are using glows scaling is allowed because id does not matter and has the effect of shortening the glow effect.

Why should I use SetBackdrop instead of SetTexture
The biggest plus of that is that your border will always be the same. It will not change it's width. So if you increase/decrease the size of a frame with that border, the border will stay constant.

If you use the trick of overlaying frame you can even create the illusion of a button. Lower layer will have a backdrop with an outer glow texture and a flat background. A layer above will have a different backdrop with just a border.

Check the mod and you will get it.

WOW API
http://wowprogramming.com/docs/widge...me/SetBackdrop
http://wowprogramming.com/docs/widge...ropBorderColor
http://wowprogramming.com/docs/widge...tBackdropColor
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 10-25-10 at 11:49 PM.
  Reply With Quote
 

WoWInterface » Developer Discussions » Tutorials & Other Helpful Info. » How to do SetBackdrop and handle 1px stuff in just one call.

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