Thread Tools Display Modes
08-18-16, 06:01 PM   #1
Sweetsour
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Dec 2014
Posts: 130
Issue with Alpha Animation

Hello!

I'm trying to create an alpha animation, but I keep getting the following error:

Code:
19: attempt to call method 'SetChange' (a nil value)
This is my code:

Lua Code:
  1. local BackdropSB = {
  2.     bgFile   = "Interface\\Tooltips\\UI-Tooltip-Background",
  3.     edgeFile = nil,
  4.     tile = true,
  5.     tileSize = 16
  6. }
  7.  
  8. local BackdropBar = CreateFrame("Frame","BackdropBar",UIParent);
  9. BackdropBar:SetPoint("CENTER",0,-95);
  10. BackdropBar:SetWidth(200);
  11. BackdropBar:SetHeight(15);
  12. BackdropBar:SetBackdrop(BackdropSB);
  13. BackdropBar:SetBackdropColor(0,0,0,1);
  14. BackdropBar:Show();
  15.  
  16. local flasher = BackdropBar:CreateAnimationGroup();
  17.  
  18. local fadeIn = flasher:CreateAnimation("Alpha");
  19. fadeIn:SetChange(0.6);
  20. fadeIn:SetDuration(1);
  21. fadeIn:SetOrder(1);
  22.  
  23. local fadeOut = flasher:CreateAnimation("Alpha");
  24. fadeOut:SetDuration(1);
  25. fadeOut:SetChange(-0.4);
  26. fadeOut:SetOrder(2);
  27. fadeOut:SetEndDelay(1);
  28.  
  29. flasher:Play();

Any help would be great, thanks!
  Reply With Quote
08-18-16, 06:08 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,897
SetChange is now

SetToAlpha
SetFromAlpha

From WoldmapFrame WoD:
Code:
	local change = endAlpha - startAlpha;
	local duration = (change / (WORLD_MAP_MAX_ALPHA - WORLD_MAP_MIN_ALPHA)) * tonumber(GetCVar("mapAnimDuration"));
	anim.Alpha:SetChange(change);
	anim.Alpha:SetDuration(abs(duration));
	anim.Alpha:SetStartDelay(startDelay);
	anim:Play();
From WoldmapFrame Legion:
Code:
	local duration = ((endAlpha - startAlpha) / (WORLD_MAP_MAX_ALPHA - WORLD_MAP_MIN_ALPHA)) * tonumber(GetCVar("mapAnimDuration"));
	anim.Alpha:SetFromAlpha(startAlpha);
	anim.Alpha:SetToAlpha(endAlpha);
	anim.Alpha:SetDuration(abs(duration));
	anim.Alpha:SetStartDelay(startDelay);
	anim:Play();
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
08-18-16, 06:40 PM   #3
Sweetsour
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Dec 2014
Posts: 130
I figured it might have been changed to something else, just didn't find any documentation on it. Thanks!
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Issue with Alpha Animation


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