Elitist Jerks
Register
Blogs
Forums


Go Back   Elitist Jerks » Blogs » Zorks interface blog

Me blogging about random interface topics.
Rate this Entry

How to handle SetBackdrop and do 1px stuff in just one call

Posted 10/26/10 at 1:40 AM by zork
Updated 10/26/10 at 1:49 AM by zork
Made a tutorial addon to let you experiment with settings.

rSetBackdrop : WoWInterface Downloads : Graphic UI Mods

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
Frame/SetBackdrop - World of Warcraft Programming: A Guide and Reference for Creating WoW Addons
Frame/SetBackdropBorderColor - World of Warcraft Programming: A Guide and Reference for Creating WoW Addons
Frame/SetBackdropColor - World of Warcraft Programming: A Guide and Reference for Creating WoW Addons
Total Comments 0

Comments

 
Total Trackbacks 0

Trackbacks