Is it possible to customize (e.g., through inheritance) and create custom effects in Flutter Flame? For example, in Siv3D, you can create a custom effect like a circle appearing at a clicked location and then disappearing. Can similar custom effects be created in Flame as well? (Note: I’m interested in creating custom effects, not specifically a circle effect).
Reference to custom effect in Siv3D: https://siv3d.github.io/ja-jp/tutorial3/effect/
Siv3D(C++):
# include <Siv3D.hpp> struct RingEffect : IEffect { Vec2 m_pos; ColorF m_color; // このコンストラクタ引数が、Effect::add<RingEffect>() の引数になる explicit RingEffect(const Vec2& pos) : m_pos{ pos } , m_color{ RandomColorF() } {} bool update(double t) override { // 時間に応じて大きくなる輪を描く Circle{ m_pos, (t * 100) }.drawFrame(4, m_color); // 1 秒未満なら継続する return (t < 1.0); } }; void Main() { Effect effect; while (System::Update()) { ClearPrint(); // アクティブなエフェクトの数 Print << U"Active effects: {}"_fmt(effect.num_effects()); if (MouseL.down()) { // エフェクトを追加する effect.add<RingEffect>(Cursor::Pos()); } // アクティブなエフェクトのプログラム IEffect::update() を実行する effect.update(); } }