Thread Tools Display Modes
04-06-09, 04:33 AM   #1
sweede
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 18
Converting Kgpanels layout; BackDrop issue

I'm trying to replace a kgpanels layout with a lightwieght addon to go along with other addons such as oUF, rActionBar, etc; but i'm having trouble setting the backdrop / border


This is the LUA code from the kgpanels saved variables
Code:
["Chat2"] = {
	["parent"] = "ChatFrame3",
	["strata"] = "BACKGROUND",
	["absolute_bg"] = {
		["ULx"] = 0,
		["ULy"] = 0,
		["LLy"] = 1,
		["LLx"] = 0,
		["URx"] = 1,
		["URy"] = 0,
		["LRx"] = 1,
		["LRy"] = 1,
	},
	["anchorTo"] = "BOTTOM",
	["scale"] = 1.03,
	["bg_orientation"] = "HORIZONTAL",
	["anchorFrom"] = "BOTTOM",
	["hflip"] = false,
	["bg_insets"] = {
		["r"] = "6",
		["t"] = "6",
		["l"] = "-6",
		["b"] = "-6",
	},
	["vflip"] = false,
	["tileSize"] = 128,
	["bg_texture"] = "Panel4",
	["anchor"] = "ChatFrame3",
	["level"] = 0,
	["border_texture"] = "Blizzard Chat Bubble",
	["use_absolute_bg"] = false,
	["bg_blend"] = "BLEND",
	["rotation"] = 0,
	["bg_style"] = "SOLID",
	["gradient_color"] = {
		["a"] = 1,
		["b"] = 1,
		["g"] = 1,
		["r"] = 1,
	},
	["border_color"] = {
		["a"] = 0.3700000047683716,
		["b"] = 0,
		["g"] = 0,
		["r"] = 0,
	},
	["text"] = {
		["y"] = 0,
		["x"] = 0,
		["justifyH"] = "CENTER",
		["font"] = "Blizzard",
		["color"] = {
			["a"] = 1,
			["b"] = 1,
			["g"] = 1,
			["r"] = 1,
		},
		["text"] = "",
		["justifyV"] = "MIDDLE",
		["size"] = 12,
	},
	["x"] = 0,
	["width"] = "100%",
	["y"] = "-11",
	["bg_color"] = {
		["a"] = 1,
		["b"] = 0.1176470588235294,
		["g"] = 0.1176470588235294,
		["r"] = 0.1176470588235294,
	},
	["bg_alpha"] = 0.75,
	["border_edgeSize"] = 6,
	["height"] = "100%",
	["mouse"] = false,
	["scripts"] = {
		["UPDATE"] = "local width, height = ChatFrame3:GetWidth(), ChatFrame3:GetHeight()\nthis:SetWidth(width+8)\nthis:SetHeight(height+16)",
	},
	["tiling"] = false,
},
And this is my addon so far.

Code:
local bg_color = {
	["a"] = 1,
	["b"] = 0.1176470588235294,
	["g"] = 0.1176470588235294,
	["r"] = 0.1176470588235294,
};

local BackDrop = {
	bgFile = "Interface\\Tooltips\\ChatBubble-Backdrop", 
	tile = true, 
	tileSize = 128,
	edgeSize = 6,
	insets = {left = -6, right = 6, top = 6, bottom = -6},
};
local BackDrop_color = {
	["a"] = 0.3700000047683716,
	["b"] = 0,
	["g"] = 0,
	["r"] = 0,
};
local width, height = ChatFrame1:GetWidth(), ChatFrame1:GetHeight();
local frame = CreateFrame("Frame", nil, UIParent);
frame:SetPoint("BOTTOM", "ChatFrame1","BOTTOM", 0, 0);
frame:SetFrameStrata("BACKGROUND");
frame:SetFrameLevel(0);
frame:SetAlpha(0.75);
frame:SetScale(1.03)
frame:SetWidth(width+8); 
frame:SetHeight(height+16);
frame:SetBackdrop(BackDrop)
frame:SetBackdropColor(BackDrop_color.r,
						BackDrop_color.g,
						BackDrop_color.b,
						BackDrop_color.a) 	
frame.texture = frame:CreateTexture(nil, "BACKGROUND");
frame.texture:SetTexture("Interface\\AddOns\\xOffended\\Panel4");
frame.texture:SetAllPoints(frame);
frame.texture:SetVertexColor(bg_color.r,
  							 bg_color.g,
							 bg_color.b,
							 bg_color.a);
frame:Show();
This is what I'm getting. The background is being set properly and looks great when i comment out the Backdrop code.



Thanks a bunch !

Last edited by sweede : 04-06-09 at 06:05 AM.
  Reply With Quote
04-06-09, 05:23 AM   #2
Kagaro
A Cyclonian
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 45
1. well one question is how much lighter are you trying to go for? kgPanels without the config loaded is < 50k for me.
2. Read the wowwiki page on backdrop table. HINT your sample didnt define a border
  Reply With Quote
04-06-09, 05:29 AM   #3
sweede
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 18
Originally Posted by Kagaro View Post
1. well one question is how much lighter are you trying to go for? kgPanels without the config loaded is < 50k for me.
2. Read the wowwiki page on backdrop table. HINT your sample didn't define a border
It's not so much lighter in memory and all that, its that kgpanels is the only addon that uses savedvariables to set up the basics
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Converting Kgpanels layout; BackDrop issue


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