I'm building a GameEngine using Ashley and some how I can't figure out how.
I through I could use something like this. Or use the Signal/Listener from Ashley. But how to Implement a interactive HUD? This is my current idea:
I have a System that only polls for inputs. If it detects an Input it would be a MouseClick so the PollySystem is sending out a MouseClickEvent witch the Coords. And a HUDClickedSystem will catch this event and checks if the click was inside a HUD Boundary and will Tag it with a clickedCompoment or not. A Third system will look out for all entities with a clickedComponent and will react something like Respawn button clicked -> Respawn, Pause button clicked -> Pause etc.
This is a mix from the ideas here and here
I would love to have something like the Command pattern / Intent System because I think it easy and straight forward but I can't figure out how to handle more than a flag ( Key pressed / Mouse pressed ). But for this I need to know where the Mouse is pressed.