Replies: 1 comment 2 replies
-
Hi, one possible way would be if entities have hit boxes, then As for component instance, yes:
Let me know if any of this works. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When I click the mouse over an entiy is there a way to return whats entity is under the cursor rather than adding events to the entity builder? Also are you able to get the with(mycomponent) instance from the entity?
I've been using code below but doesn't seem very efficient. It's creating a handler every instance and there could be several hundred entity in the game world.
entity.getViewComponent().addOnClickHandler(event -> { buildingClick(event, entity); });
I have noticed theres a IsCollision method which could be used? Just for context the game is an RTS and when you click on people, troops, tanks etc I need to be able to give them directions. Also when I click on a building I need to see it's options and info.
Beta Was this translation helpful? Give feedback.
All reactions