Skip to content
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

Added function to test hit on nodes in the animation. #289

Open
wants to merge 2 commits into
base: stable
Choose a base branch
from

Conversation

gnudles
Copy link

@gnudles gnudles commented Dec 18, 2020

Very useful feature, that should help with making animatable buttons etc..
When extending FlareControls and overriding setViewTransform, one should add call to "super.setViewTransform(viewTransform);" in order to make it work.
Example:
wrap your FlareActor with GestureDetector. add onTapDown Event, and ask the flare controller which nodes were clicked.
GestureDetector(child: FlareActor(
"assets/Teddy.flr",
shouldClip: false,
alignment: Alignment.bottomCenter,
fit: BoxFit.contain,
controller: _teddyController,
), onTapDown : (details){
print (_teddyController.deepHitTest(details.globalPosition));
}
)

Very useful feature, that should help with making animatable buttons etc..
When extending FlareControls and overriding setViewTransform, one should add call to "super.setViewTransform(viewTransform);" in order to make it work.
Example:
wrap your FlareActor with GestureDetector. add onTapDown Event, and ask the flare controller which nodes were clicked.
			GestureDetector(child: FlareActor(
                            "assets/Teddy.flr",
                            shouldClip: false,
                            alignment: Alignment.bottomCenter,
                            fit: BoxFit.contain,
                            controller: _teddyController,
                          ), onTapDown : (details){
                            print (_teddyController.deepHitTest(details.globalPosition));
                          }
                          )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant