mirror of
https://github.com/flame-engine/flame.git
synced 2025-10-30 08:27:36 +08:00
docs: Deprecate TapDetector in favour of TapCallbacks (#2886)
Deprecate `TapDetector` in favour of `TapCallbacks`
This commit is contained in:
@ -10,7 +10,7 @@ import 'package:flame/palette.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class RaycastLightExample extends FlameGame
|
||||
with HasCollisionDetection, TapDetector, MouseMovementDetector {
|
||||
with HasCollisionDetection, TapCallbacks, MouseMovementDetector {
|
||||
static const description = '''
|
||||
In this example the raycast functionality is showcased by using it as a light
|
||||
source, if you move the mouse around the canvas the rays will be cast from its
|
||||
@ -88,9 +88,8 @@ with with mouse.
|
||||
}
|
||||
|
||||
@override
|
||||
void onTapDown(TapDownInfo info) {
|
||||
super.onTapDown(info);
|
||||
final origin = info.eventPosition.widget;
|
||||
void onTapDown(TapDownEvent event) {
|
||||
final origin = event.canvasPosition;
|
||||
isTapOriginCasted = origin == tapOrigin;
|
||||
tapOrigin = origin;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user