Making Flame events aware of camera (#755)

* some initial refactoring

* Fixing examples and joystick component

* Fixing examples

* Addressing comments from PR

* Fixing tutorials

* Updating docs

* Fixing tests

* PR followup

* A big follow up

* linting

* doc nit

* Changelog and fix tutorial

* Addressing comments

* Fixing BaseGame project and scale offset methods

* Formatting

* doc suggestions

* Update packages/flame/lib/src/gestures/events.dart

Co-authored-by: Luan Nico <luanpotter27@gmail.com>

* Hopefully, the last follow up

* Linting and adding dart-code-metrics again

* fixing tutorial

Co-authored-by: Luan Nico <luanpotter27@gmail.com>
This commit is contained in:
Erick
2021-04-15 15:28:46 -03:00
committed by GitHub
parent 1c2f03903b
commit 6b2f8032fe
38 changed files with 1073 additions and 757 deletions

View File

@ -3,7 +3,6 @@ import 'dart:ui';
import 'package:flame/components.dart';
import 'package:flame/game.dart';
import 'package:flame/gestures.dart';
import 'package:flutter/gestures.dart' show TapDownDetails;
class BasicAnimations extends BaseGame with TapDetector {
late Image chopper;
@ -64,7 +63,7 @@ class BasicAnimations extends BaseGame with TapDetector {
}
@override
void onTapDown(TapDownDetails evt) {
addAnimation(Vector2(evt.globalPosition.dx, evt.globalPosition.dy));
void onTapDown(TapDownInfo event) {
addAnimation(event.eventPosition.game);
}
}