Thread Tools Display Modes
Prev Previous Post   Next Post Next
06-27-16, 08:33 PM   #1
n0t4h4cker
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Mar 2016
Posts: 5
Alpha Animation Script Issue

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)
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Alpha Animation Script Issue


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off