So, I currently have the following code written.
Lua Code:
A.CreateDruidMana = function(f, unit)
local DruidMana = CreateFrame("StatusBar", "DruidMana", f);
DruidMana:SetStatusBarTexture(POWER_BAR);
DruidMana:SetOrientation("VERTICAL");
DruidMana.background = DruidMana:CreateTexture(nil, "BACKGROUND");
DruidMana.background:SetTexture(BACKDROP);
DruidMana.background:SetVertexColor(0.1, 0.1, 0.1, 1);
DruidMana.background:SetSize(10, f:GetHeight());
DruidMana.background:SetPoint("LEFT", f, "RIGHT", 2, 0);
DruidMana:SetPoint("TOPLEFT", DruidMana.background, "TOPLEFT", 2, -2);
DruidMana:SetPoint("BOTTOMRIGHT", DruidMana.background, "BOTTOMRIGHT", -2, 2);
local bg = DruidMana:CreateTexture(nil, "BACKGROUND");
bg:SetAllPoints(true);
bg:SetTexture(BACKDROP);
A.AddOptions(DruidMana, "frequentUpdates");
bg.multiplier = 0.2;
f.DruidMana = DruidMana;
f.DruidMana.bg = bg;
end
The reason that I created another texture called Background is to create a outer background like the following image:
However, I would like to Create "DruidMana" as a "Frame" rather than "StatusBar" and create "StatusBar" called "Bar" which becomes child object of "DruidMana" then Set Backdrop for "DruidMana" which I would like to use as outer frame instead of using texture called "Background".
Which would become:
Lua Code:
local DruidMana = CreateFrame("Frame", "DruidMana", f);
local Bar = CreateFrame("StatusBar", nil, DruidMana);
local bg = Bar:CreateTexture(nil, "BACKGROUND");
I actually tried it, but it was not possible to set "DruidMana" as "f.DruidMana" since "DruidMana" was set to "Frame", not "StatusBar".
In addition to that even if I set "Bar" as "f.DruidMana", "DruidMana" does not hide on shape shift...
Could I please get an advice regarding this?