From d51a612f8bed2a7a294444e5f11402394dfbc3cd Mon Sep 17 00:00:00 2001 From: Lukas Klingsbo Date: Sat, 15 Apr 2023 17:49:11 +0200 Subject: [PATCH] fix: Fill in mount implementation in `HasTappables` (#2496) HasTappables also needs the same full implementation in mount as HasTappableComponents has for Tappable to work properly. --- packages/flame/lib/src/game/mixins/has_tappables.dart | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/flame/lib/src/game/mixins/has_tappables.dart b/packages/flame/lib/src/game/mixins/has_tappables.dart index 44aa7319b..3882e7917 100644 --- a/packages/flame/lib/src/game/mixins/has_tappables.dart +++ b/packages/flame/lib/src/game/mixins/has_tappables.dart @@ -79,7 +79,16 @@ mixin HasTappables on FlameGame implements MultiTapListener { void mount() { gestureDetectors.add( MultiTapGestureRecognizer.new, - (MultiTapGestureRecognizer instance) {}, + (MultiTapGestureRecognizer instance) { + instance.longTapDelay = Duration( + milliseconds: (longTapDelay * 1000).toInt(), + ); + instance.onTap = handleTap; + instance.onTapDown = handleTapDown; + instance.onTapUp = handleTapUp; + instance.onTapCancel = handleTapCancel; + instance.onLongTapDown = handleLongTapDown; + }, ); super.mount(); }