mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-13 19:30:14 +08:00
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.
This commit is contained in:
@@ -79,7 +79,16 @@ mixin HasTappables on FlameGame implements MultiTapListener {
|
|||||||
void mount() {
|
void mount() {
|
||||||
gestureDetectors.add<MultiTapGestureRecognizer>(
|
gestureDetectors.add<MultiTapGestureRecognizer>(
|
||||||
MultiTapGestureRecognizer.new,
|
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();
|
super.mount();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user