FXGL icon indicating copy to clipboard operation
FXGL copied to clipboard

How can I add a click event to a 3d entity when I set settings.set3D(true)

Open cnless opened this issue 1 year ago • 2 comments

I have tried using entity.getViewComponent().addOnClickHandler and entityBuilder().onClick, but it seems that these methods do not work.

cnless avatar Jun 13 '24 14:06 cnless

Hi, that's a good point. The 3d counterpart will probably need a separate implementation.

For now, I've found this: https://stackoverflow.com/questions/28863312/javafx-3d-graphics-mouse-click-position-on-3d-object

See if it works for your use case. If yes, I can use the proposed solution as a basis.

AlmasB avatar Jun 16 '24 12:06 AlmasB

Hi, that's a good point. The 3d counterpart will probably need a separate implementation.

For now, I've found this: https://stackoverflow.com/questions/28863312/javafx-3d-graphics-mouse-click-position-on-3d-object

See if it works for your use case. If yes, I can use the proposed solution as a basis.

I have found the cause of the problem.The entity seems to be obscured by my UINode.

cnless avatar Jun 20 '24 07:06 cnless