Hi all,
I should have gone to 'Graphics Help' forum rather than here, 'Lua/XML Help', but I guess this is more like a Lua related issue.
So, I've created a generic
Template function for my frames like the following:
Lua Code:
function CustomFunc:SetTemplate(whatType, anchor)
local anchor = anchor or self;
local backdrop = LSM:Fetch("background", "backdrop");
local fer12 = LSM:Fetch("border", "fer12");
local template = CreateFrame("Frame", anchor:GetName() .. "Template", self);
template:SetFrameLevel(self:GetFrameLevel());
if whatType == 1 then -- Extend
template:SetPoint("TOPLEFT", anchor, "TOPLEFT", -1, 1);
template:SetPoint("BOTTOMRIGHT", anchor, "BOTTOMRIGHT", 1, -1);
elseif whatType == 2 then -- Shrink
template:SetPoint("TOPLEFT", anchor, "TOPLEFT", 1, -1);
template:SetPoint("BOTTOMRIGHT", anchor, "BOTTOMRIGHT", -1, 1);
else -- Default
template:SetAllPoints(anchor);
end
template:SetBackdrop({
bgFile = backdrop,
edgeFile = fer12,
edgeSize = 2,
});
template:SetBackdropColor(0.1, 0.1, 0.1);
template:SetBackdropBorderColor(0.7, 0.7, 0.7);
anchor.template = template;
end
Then I applied this to frame and resized the that frame.
Lua Code:
bar = CreateFrame("StatusBar", "TestBar", UIParent);
bar:SetPoint("CENTER");
bar:SetSize(46, 10);
bar:SetTemplate(1);
bar:SetWidth(55); -- Modify width
Since the template frame's size varies based on its anchor points, I thought this would work fine, but as you can see the image below, left & right borders are gone once I changed the width of parent frame, bar.
(Well, they are definitely there, but is not rendered(?) properly)
I also attempted to change those regions' draw layer, but that didn't solve the problem
Could anyone please help me out regarding this?
Thank you!
*EDIT: Applying insets to backdrop didn't do the trick as well.
Code:
insets = {
left = 1,
right = 1,
top = 1,
bottom = 1,
},
**EDIT: Here I've attached those texture files!