Hi again all,
First of all, I apologize as I feel like I'm spamming on this forum
...
I was trying to create a castbar and it was pretty easy to handle with.
Here's what I have done so far.
Lua Code:
A.CreateCastbar = function(f, unit)
local Castbar = CreateFrame("StatusBar", "$parentCastbar", f);
Castbar:SetStatusBarTexture(POWER_BAR);
Castbar:SetSize(348, 33);
Castbar:SetPoint("CENTER", UIParent, "CENTER", 20, -350);
Castbar.border = {};
A.CreateEightBorders(Castbar, Castbar, "Border", BACKDROP, {0, 0, 0, 1});
Castbar.bg = Castbar:CreateTexture(nil, "BACKGROUND");
Castbar.bg:SetAllPoints(true);
Castbar.bg:SetTexture(BACKDROP);
Castbar.bg:SetVertexColor(0.20, 0.20, 0.20, 1);
local Spark = Castbar:CreateTexture(nil, "OVERLAY");
Spark:SetSize(20, 20);
Spark:SetBlendMode("ADD");
local Time = Castbar:CreateFontString(nil, "OVERLAY");
Time:SetFont(VALUE_FONT, 15, "OUTLINE");
Time:SetPoint("RIGHT", Castbar, "RIGHT", -5, 0);
local Icon = Castbar:CreateTexture(nil, "OVERLAY");
Icon:SetSize(33, 33);
Icon:SetPoint("RIGHT", Castbar, "LEFT", -5, 0);
Icon.border = {};
A.CreateEightBorders(Icon, Castbar, "Border", BACKDROP, {0, 0, 0, 1});
f.Castbar = Castbar;
f.Castbar.bg = Castbar.bg;
f.Castbar.Spark = Spark;
f.Castbar.Time = Time;
f.Castbar.Icon = Icon;
end
This is working fine, but I currently have one concern.
Since Castbar and Castbar.Icon are two different objects(?) (I know Icon is a child object, texture, of Castbar...), in order for me to center the entire thing, it looks like I'll have to manually move the castbar to the right by certain amount and that's why I moved Castbar frame by 20.
So, my question is that whether it is possible or not to move two things, Castbar and Castbar.Icon, as a group so that it maintain x-offset of Castbar to 0.
I hope you guys understand what I'm trying to say lel