docs: Deprecate TapDetector in favour of TapCallbacks (#2886)

Deprecate `TapDetector` in favour of `TapCallbacks`
This commit is contained in:
Luan Nico
2025-10-02 13:21:05 -07:00
committed by GitHub
parent 36eb3929aa
commit b173697bfb
35 changed files with 90 additions and 83 deletions

View File

@ -1,8 +1,9 @@
import 'package:flame/components.dart';
import 'package:flame/events.dart';
import 'package:flame/game.dart';
import 'package:flame/input.dart';
class NineTileBoxExample extends FlameGame with TapDetector, DoubleTapDetector {
class NineTileBoxExample extends FlameGame
with TapCallbacks, DoubleTapDetector {
static const String description = '''
If you want to create a background for something that can stretch you can
use the `NineTileBox` which is showcased here.\n\n
@ -27,7 +28,7 @@ class NineTileBoxExample extends FlameGame with TapDetector, DoubleTapDetector {
}
@override
void onTap() {
void onTapDown(_) {
nineTileBoxComponent.scale.scale(1.2);
}