In my code, I have created a animation for a frame to fade in. (Alpha: 0 ----> Alpha: 1)
However when I set a script to set the alpha to 1 when the animation finishes (keep the frame shown),the SetAlpha on the frame does not stay.
Does anyone know what is going wrong?
Code:
local menuFrame = CreateFrame("Frame", "SAO_MainMenu", UIParent)
menuFrame:SetSize(120,300)
menuFrame:SetPoint("CENTER", UIParent, "CENTER")
menuFrame:SetAlpha(0)
-- Lock1
menuFrame.playerLock = CreateFrame("Button", "$parentLock1", menuFrame)
menuFrame.playerLock:SetSize(42,42)
menuFrame.playerLock:SetPoint("CENTER", "$parent", "TOP")
menuFrame.playerLock.text = menuFrame.playerLock:CreateTexture("bg_test", "ARTWORK")
menuFrame.playerLock.text:SetTexture("Interface\\AddOns\\sao\\media\\inventoryequipmentlock")
menuFrame.playerLock.text:SetSize(42,42)
menuFrame.playerLock.text:SetPoint("CENTER", "$parent", "CENTER")
-- Lock2
menuFrame.friendsLock = CreateFrame("Button", "$parentLock2", menuFrame)
menuFrame.friendsLock:SetSize(42,42)
menuFrame.friendsLock:SetPoint("TOP", "$parentLock1", "BOTTOM", 0, -5)
menuFrame.friendsLock.text = menuFrame.friendsLock:CreateTexture("bg_test2", "ARTWORK")
menuFrame.friendsLock.text:SetTexture("Interface\\AddOns\\sao\\media\\friendguildlock")
menuFrame.friendsLock.text:SetSize(42,42)
menuFrame.friendsLock.text:SetPoint("CENTER", "$parent", "CENTER")
-----------------------------------------------------
menuFrame.animation = menuFrame:CreateAnimationGroup()
local a1 = menuFrame.animation:CreateAnimation("Alpha")
a1:SetChange(1)
a1:SetDuration(1)
a1:SetScript("OnFinished", function(self)
print("Inside")
menuFrame:SetAlpha(1)
end)