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 !