View Single Post
06/09/14, 02:22 PM   #6
Specko
 
Specko's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 16
First off, thanks for posting this. I am having an issue trying to implement the simple animation. I am using the event for mount status change and the function triggers fine. My issue is with the starting alpha of my label control.

For the below I'm getting attempt to index a nil value for

Code:
--label
    c.label = wm:CreateControl(nil, c, CT_LABEL)
    c.label:SetDimensions(300,200)
	c.label:SetAnchor(CENTER, c, CENTER, 75, -150)
	c.label:SetFont(path .. "|" .. size .. "|" ..  style)
	c.label:SetColor( 128,128,0,.5 )
	c.label:SetHorizontalAlignment( CENTER )
	c.label:SetVerticalAlignment( CENTER )
	c.label:SetText ( "Changed mount status!" )

	return c

  end

  function KillingBlow:simpleAnimation(controlToAnim, duration)
    local animation, timeline = CreateSimpleAnimation(ANIMATION_ALPHA, controlToAnim)

    print("setAlphaValues")
    animation:SetAlphaValues(controlToAnim:GetAlpha(), 1) --Nil value line controlToAnim:GetAlpha()
	print("SetDuration")
    animation:SetDuration(duration or 1000)

    timeline:SetPlaybackType(ANIMATION_PLAYBACK_ONE_SHOT)
    timeline:PlayFromStart()
  end
  Reply With Quote