Fading a sprite in a tween



  • I am trying to simply fade a sprite object ( a coin ) to transparent over a couple of seconds.

    I managed to get it to fade, but it goes black first. I think I need alpha i there somewere!
    This is the line I used, I think I am close but, help please. Thanks Lee

    var tween1 = FlxTween.color(sprite, 5, FlxColor.BLACK, FlxColor.fromRGB(255, 255, 50, 0));



  • Try

    player.alpha = 1;
    FlxTween.tween(sprite, { alpha: 0 }, 1.5, { ease: FlxEase.expoOut } );
    


  • Thank you, IT works. very quick! Lee


Log in to reply