Skip to content

Comments

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

Open
gnudles wants to merge 2 commits into2d-inc:stablefrom
gnudles:hit_test_node
Open

Added function to test hit on nodes in the animation.#289
gnudles wants to merge 2 commits into2d-inc:stablefrom
gnudles:hit_test_node

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