Skip to content

Commit 87453b3

Browse files
committed
Fixes
1 parent 9260467 commit 87453b3

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

doc/bridge_packages/flame_spine/flame_spine.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void main() async {
2121
runApp(const GameWidget.controlled(gameFactory: SpineExample.new));
2222
}
2323
24-
class FlameSpineExample extends FlameGame with TapDetector {
24+
class FlameSpineExample extends FlameGame {
2525
late final SpineComponent spineboy;
2626
2727
@override

doc/flame/examples/lib/ember.dart

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,19 @@ class EmberPlayer extends SpriteAnimationComponent with TapCallbacks {
3535
}
3636

3737
@override
38-
void onTapUp([TapUpEvent? event]) => _onTap?.call(this);
38+
void onTapDown(TapDownEvent event) {
39+
if (_onTap == null) {
40+
event.continuePropagation = true;
41+
}
42+
}
43+
44+
@override
45+
void onTapUp(TapUpEvent event) {
46+
final onTap = _onTap;
47+
if (onTap == null) {
48+
event.continuePropagation = true;
49+
} else {
50+
onTap.call(this);
51+
}
52+
}
3953
}

doc/flame/examples/lib/ray_trace.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import 'package:flame/palette.dart';
99
import 'package:flutter/material.dart';
1010

1111
class RayTraceExample extends FlameGame
12-
with HasCollisionDetection, TapDetector {
12+
with HasCollisionDetection, TapCallbacks {
1313
Paint paint = Paint()..color = Colors.red.withValues(alpha: 0.6);
1414
bool isClicked = false;
1515

@@ -79,8 +79,7 @@ class RayTraceExample extends FlameGame
7979
}
8080

8181
@override
82-
void onTap() {
83-
super.onTap();
82+
void onTapUp(TapUpEvent event) {
8483
if (!isClicked) {
8584
isClicked = true;
8685
return;

doc/flame/examples/lib/remove_effect.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import 'package:flame/effects.dart';
44
import 'package:flame/events.dart';
55
import 'package:flame/game.dart';
66

7-
class RemoveEffectGame extends FlameGame with TapDetector {
7+
class RemoveEffectGame extends FlameGame with TapCallbacks {
88
static const double delayTime = 3;
99
late EmberPlayer ember;
1010
late TextComponent textComponent;
@@ -22,7 +22,7 @@ class RemoveEffectGame extends FlameGame with TapDetector {
2222
}
2323

2424
@override
25-
void onTap() {
25+
void onTapUp(TapUpEvent event) {
2626
if (children.contains(ember)) {
2727
ember.add(effect);
2828
} else {

0 commit comments

Comments
 (0)