flame-engine / flame-engine/flame
Ability to specify if the event mixins should only receive events within their bounds
- Dominant language
- Dart
- Stars
- 10.8k
- Forks
- 1k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 21
Description
# What could be improved
The different `*Callbacks` mixins should be configurable to allow for components to receive any events, regardless if they are "inside" the component or not; for example:
```
class FooComponent extends PositionComponent with TapCallbacks {
@override
void onTapDown(TapDownEvent event) {
// only gets this if the click is inside the component (based on position & size)
}
// false by default; or some other name like this
@override
bool get receiveAllTapCallbacks => true;
}
```
Same for the other similar mixins.
# Why should this be improved
Sometimes you want to listen to all events, so you can better organize logic within components and don't have to have things on the root level.
# Any risks?
No.
Contributor guide
Assessment
This issue has not been assessed yet.