Maybe (if the above is the effect you're looking for):
Lua Code:
local duration = 2.0;
local width = 50;
local center = CreateFrame("frame", UIParent); -- the red square
center:SetPoint("CENTER", 0, 0)
center:SetSize(2, 2);
local centerTex = center:CreateTexture();
centerTex:SetColorTexture(1, 0, 0, .9);
centerTex:SetAllPoints(center);
local frame = CreateFrame("frame", UIParent); -- Host for the AnimationGroup and anchor for the rotating texture
frame:SetSize(1, 1)
frame:SetPoint("CENTER", center, "CENTER", 0, 0)
local tex = frame:CreateTexture(); -- Rotation animation (rot0) SetChildKey targets this texture to rotate
frame.tex = tex -- through this key
tex:SetColorTexture(0, 1, 0, .2);
--tex:SetAllPoints(frame);
tex:SetSize(width, width * 2)
tex:SetPoint("LEFT", frame, "CENTER")
local ag = frame:CreateAnimationGroup();
ag:SetLooping("REPEAT")
local rot0 = ag:CreateAnimation("Rotation");
rot0:SetChildKey("tex")
rot0:SetDegrees(360);
rot0:SetDuration(duration);
rot0:SetEndDelay(0);
rot0:SetOrigin("LEFT", 0, 0);
ag:Play();