-
-
Notifications
You must be signed in to change notification settings - Fork 895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PolygonComponent does not respond to hover and click event regions #3031
Comments
What Flame version is this with? As far as I know we've never had a method with this signature in bool onTapDown(TapDownEvent event) { That bool return is from the old events |
Its the hover events that are an issue. I added the onTapDown event handler to test if it was a problem too (and it is). The version of Flame is 1.15. /// Called when the user touches the device screen within the game canvas,
/// either with a finger, a stylus, or a mouse.
///
/// The handler propagates the [event] to any component located at the point
/// of touch and that uses the [TapCallbacks] mixin. The event will be first
/// delivered to the topmost such component, and then propagated to the
/// components below only if explicitly requested.
///
/// Each [event] has an `event.pointerId` to keep track of multiple touches
/// that may occur simultaneously.
@mustCallSuper
void onTapDown(TapDownEvent event) {
event.deliverAtPoint(
rootComponent: game,
eventHandler: (TapCallbacks component) {
_record.add(TaggedComponent(event.pointerId, component));
component.onTapDown(event);
},
);
} |
I see, and you said the |
This seems to be the cause: #2930 |
Alright, now I fixed it! (it wasn't the fault of #2930 at all, it just happened to break it). Replace flame with the following in your pubspec to depend on the branch: dependencies:
flame:
git:
url: https://github.com/flame-engine/flame.git
ref: fix/polygon-component-vertices
path: packages/flame |
This fixed it! I also verified it against |
Super, thanks for checking! |
What happened?
Creating a descendant of PolygonComponent did not respond correctly trigger hover and click events.
What do you expect?
When using over a PolygonComponent it should trigger hover and click events when rotated.
How can we reproduce this?
What steps should take to fix this?
No response
Do have an example of where the bug occurs?
No response
Relevant log output
No response
Execute in a terminal and put output into the code block below
Affected platforms
Linux, Web
Other information
No response
Are you interested in working on a PR for this?
The text was updated successfully, but these errors were encountered: