Skip to content

Commit 9260467

Browse files
committed
docs: Deprecate TapDetector in favour of TapCallbacks
1 parent 9480b9d commit 9260467

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/flame/lib/src/events/component_mixins/tap_callbacks.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ import 'package:meta/meta.dart';
1010
/// In addition to adding this mixin, the component must also implement the
1111
/// [containsLocalPoint] method -- the component will only be considered
1212
/// "tapped" if the point where the tap has occurred is inside the component.
13+
///
14+
/// Note that FlameGame _is_ a [Component] and does implement
15+
/// [containsLocalPoint]; so this can be used at the game level.
1316
mixin TapCallbacks on Component {
1417
void onTapDown(TapDownEvent event) {}
1518
void onLongTapDown(TapDownEvent event) {}

packages/flame/lib/src/gestures/detectors.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import 'package:flame/src/game/game.dart';
22
import 'package:flame/src/gestures/events.dart';
33
import 'package:flutter/gestures.dart';
44

5-
// Basic touch detectors
5+
@Deprecated('Use TapCallbacks instead')
66
mixin TapDetector on Game {
77
void onTap() {}
88
void onTapCancel() {}

0 commit comments

Comments
 (0)