Closed bung87 closed 4 years ago
Flame components are not Flutter widgets, so you can't use AnimationController. To make a component fade, you will need to manipulate the Paint
opacity that is used to render that component.
This probably can give you some idea: https://github.com/erickzanardo/cave-ace/blob/c2ef124c7b2e53cddb28c71eacf1f9b1b9311c4e/cave_ace/lib/components/effects/hit_effect.dart#L17
Thank you ! this is helpful, I have suggestion , I think better have ComponentEffect
as basic class contains Component
could be generic type make it more flexible.
That is actually a pretty good idea @bung87, I did an implementation of it here https://github.com/flame-engine/flame/pull/484 if you want to have a look.
nice!! That's what I need.
I want create a simple fade out animation, I know flutter can use
AnimationController
inwidget
which is simple. however in component I can't get rightthis
context pass toAnimationController
'svsync
parameter . below is the code demonstrate the logic.