Minion Beta! - Help us test our new AddOn updater. Get it now!
Download
(58 Kb)
Download
Updated: 10-25-10 01:51 PM
Pictures
File Info
Updated:10-25-10 01:51 PM
Created:10-25-10 03:12 AM
Downloads:1,570
Favorites:14
MD5:
rSetBackdrop
Version: 4.003
by: zork [More]

Intro
The intention of the mod is to teach how to use the SetBackdrop feature.

SetBackdrop can be used on 4 occasions. To create a background, a border, an outer-glow and an inner-glow.

It includes a small addon and some textures for borders, glows and backgrounds.

Color can be applied to SetBackdrop via SetBackdropBorderColor and SetBackdropColor. Even the alpha value can be set there.

Adding color to a black area is not possible. 0*0 = 0. The lighter the color, the more the choosen color will become visible. If you apply a red color to a white area that area will be completly red.

Another important part of the texture is the alpha layer. Black areas will be transparent, white areas will be visible. http://en.wikipedia.org/wiki/Alpha_compositing

As you can see in the screenshots the tooltip texture is split into 8 parts, each 16x16 pixel in size, thuse 128x16px in full size. This will make it possible to calculate graphics for every corner and every side.
Addon
Move the frame via SHIFT+LEFTCLICKDRAG.
Resize the frame via ALT+LEFTCLICKDRAG.

Frames that show a spell texture will stay at a square (looks ugly otherwise )
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
Border examples



Background examples
SVN
http://code.google.com/p/rothui/sour.../rSetBackdrop/
4.003
- inner glow added

4.002
-added the testmod
Optional Files (0)


Archived Files (2)
File Name
Version
Size
Author
Date
4.002a
52kB
zork
10-25-10 12:57 PM
4.002
48kB
zork
10-25-10 03:12 AM


Post A Reply Comment Options
Unread 06-12-11, 12:13 AM  
feraldrood
An Aku'mai Servant
 
feraldrood's Avatar

Forum posts: 39
File comments: 35
Uploads: 0
thanks for the quick response zork,

well i tried your code but that simply made a square outline wayy too small for the icon size, so I changed the " -1,1 " etc.. text to something more along the lines of 15 or 16 pixels, which worked but still wasnt pixel perfect.

SO.. lol I tried disabling bagnon etc.. just to see if oglow could do it on the default bags, ofc. that didnt work either

My guess, is that the problem lies within the actual size of the bags themselves or something. I mean other than that i have no clue lol.

*Edit* the thing that bugs me though is that the glow works perfect on the char frame. (Going to take a page out of freeui and see what I can do w/ his code)

thanks again
feraldrood is offline Report comment to moderator  
Reply With Quote
Unread 06-11-11, 05:39 PM  
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1372
File comments: 3308
Uploads: 87
All I know is that WoW now supports pixel perfection but to do that you either need a backdrop without being scaled or have a background texture that has the same setpoint as the icon just one pixel more on each edge.

Try:
Code:
      border:SetPoint("TOPLEFT", item, "TOPLEFT", -1, 1)
      border:SetPoint("BOTTOMRIGHT", item, "BOTTOMRIGHT", 1, -1)
instead of:
Code:
	border:SetWidth(68)
	border:SetHeight(68)
	border:SetPoint('CENTER', 0,0)
__________________
| Simple is beautiful.
| Roth UI | Roth UI FAQ | GoogleCode | Zork | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
zork is offline Report comment to moderator  
Reply With Quote
Unread 06-11-11, 02:38 PM  
feraldrood
An Aku'mai Servant
 
feraldrood's Avatar

Forum posts: 39
File comments: 35
Uploads: 0
hey zork, so heres my prob:

http://postimage.org/gallery/1nezf3bxk/

In both images, the glow texture is not pixel perfect, the first is pretty close but not quite there.

I'm using bagnon and oglow, but bagnon already has a glow feature built into the lua: that, is the lua that I'm trying to modify to get a perfect square

additionally, I'm using aurora to skin ui frames including the bag textures.

My question: would modifying the "SetTexture" lua found in bagnon to your setbackdrop approach in rSetBackdrop, fix this little issue?

Code:
--constructs a brand new item slot
function ItemSlot:Create()
	local id = self:GetNextItemSlotID()
	local item = self:Bind(self:GetBlizzardItemSlot(id) or self:ConstructNewItemSlot(id))
	item:Hide()

	--add a quality border texture
	item.questBorder = _G[item:GetName() .. 'IconQuestTexture']

	local border = item:CreateTexture(nil, 'OVERLAY')
	border:SetWidth(68)
	border:SetHeight(68)
	border:SetPoint('CENTER', 0,0)
	border:SetTexture([[Interface\Buttons\UI-ActionButton-Border]])
	border:SetBlendMode('ADD')
	border:Hide()
	item.border = border

	--hack, make sure the cooldown model stays visible
	item.cooldown = _G[item:GetName() .. 'Cooldown']

	--get rid of any registered frame events, and use my own
	item:SetScript('OnEvent', nil)
	item:SetScript('OnEnter', item.OnEnter)
	item:SetScript('OnLeave', item.OnLeave)
	item:SetScript('OnShow', item.OnShow)
	item:SetScript('OnHide', item.OnHide)
	item:SetScript('PostClick', item.PostClick)
	item:HookScript("OnClick", item.ItemClicked)

	item.UpdateTooltip = nil

	return item
end
I hope you can help ;P thanks for your time
feraldrood is offline Report comment to moderator  
Reply With Quote
Unread 01-26-11, 06:43 AM  
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1372
File comments: 3308
Uploads: 87
Re: cfg as a frame

Not sure, but I think any kind of object will do. So probably yes.
__________________
| Simple is beautiful.
| Roth UI | Roth UI FAQ | GoogleCode | Zork | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
zork is offline Report comment to moderator  
Reply With Quote
Unread 01-26-11, 05:43 AM  
leizeQ
A Murloc Raider
 
leizeQ's Avatar
AddOn Compiler - Click to view compilations

Forum posts: 8
File comments: 44
Uploads: 1
cfg as a frame

Hi.

Don't know where to ask else and seen it in this addon so I try to ask here.

In config.lua, you create the cfg containter. Why is it a frame? Isn't a table enough?

Thanks.
leizeQ is offline Report comment to moderator  
Reply With Quote
Unread 11-02-10, 08:03 AM  
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1372
File comments: 3308
Uploads: 87
Lol...actually this is a developer mod. But if you can replace eePanels with that..good for you
__________________
| Simple is beautiful.
| Roth UI | Roth UI FAQ | GoogleCode | Zork | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
zork is offline Report comment to moderator  
Reply With Quote
Unread 11-02-10, 06:39 AM  
TzuArath
A Murloc Raider

Forum posts: 4
File comments: 9
Uploads: 0
You should probably change the default strata level to low, I had to add ChatFrame1:SetFrameStrata("medium") to not get the chat covered by the backdrop... Otherwise I love this addon, much simpler than eepanels / Kgpanels and it uses less memory
keep up the good work
TzuArath is offline Report comment to moderator  
Reply With Quote
Unread 10-25-10, 10:47 PM  
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1372
File comments: 3308
Uploads: 87
Use /fstack ingame and hover the mouse over the icon.
This will tell you which icon it is in the config.

Now you could just copy the whole addon only with that one config setting. (Make sure you change the number to 1, they need to count upwards, the one in the brackets. [..])

Check the config settings and see what is done with them in the core.lua.

Under specific conditions some frames will be spawned on others they don't.

Experiment around with the settings a bit to get a feeling.
__________________
| Simple is beautiful.
| Roth UI | Roth UI FAQ | GoogleCode | Zork | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
Last edited by zork : 10-25-10 at 10:48 PM.
zork is offline Report comment to moderator  
Reply With Quote
Unread 10-25-10, 08:29 PM  
Oraknathal
A Flamescale Wyrmkin
 
Oraknathal's Avatar

Forum posts: 143
File comments: 19
Uploads: 0
I like the one that has i slight shadow around.but im fairly new to lua can u tell me how to duplicate it?
Oraknathal is offline Report comment to moderator  
Reply With Quote
Unread 10-25-10, 02:33 PM  
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1372
File comments: 3308
Uploads: 87
Added some more examples to the SVN version.

1px borders are np aswell. Just add iconpadding of 1px and use a plain background. Really easy to do.
__________________
| Simple is beautiful.
| Roth UI | Roth UI FAQ | GoogleCode | Zork | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
zork is offline Report comment to moderator  
Reply With Quote
Unread 10-25-10, 12:10 PM  
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view AddOns

Forum posts: 1372
File comments: 3308
Uploads: 87
First test done.
http://img253.imageshack.us/i/wowscr...510200336.jpg/

As you can see the borders where actually nearly right. Only top+bottom is misplaced.

So the side of the tooltip border textre are: LEFT, RIGHT, TOP, BOTTOM

Now it's possible to adjust graphically made tooltips like the Diablo 3 one accordingly.
__________________
| Simple is beautiful.
| Roth UI | Roth UI FAQ | GoogleCode | Zork | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
zork is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: