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

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

Open
cnless opened this issue Jun 13, 2024 · 2 comments
Open
Labels
type:new feature Adding a feature that isn't currently present

Comments

@cnless
Copy link

cnless commented Jun 13, 2024

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

@cnless cnless added the type:new feature Adding a feature that isn't currently present label Jun 13, 2024
@AlmasB
Copy link
Owner

AlmasB commented Jun 16, 2024

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.

@cnless
Copy link
Author

cnless commented Jun 20, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:new feature Adding a feature that isn't currently present
Projects
None yet
Development

No branches or pull requests

2 participants