4 ms·
Yeah, before you know it, you’re in the land of colliding mouse down events. Best I’ve been able to do is group interaction views together (think inventory and
by softfalcon 6y ago
Yeah, before you know it, you’re in the land of colliding mouse down events.
Best I’ve been able to do is group interaction views together (think inventory and character menus vs the character controller).
Separate these view groups so they are triggered by a mode state using an event system that tells each view group which is active.
Only update the active view group.
This isolates each view group to receive mouse/key events by itself. It also keeps menus that interact with one another consolidated together in one place. This helps you reason out the mouse/key events more easily since you know this view group won’t disrupt the other inactive view groups.
Within a view group though, a focused control pattern is a good idea. A simple way is via hit bounding and z-ordering. The top-most, mouse over bounds control is active to receive click events. Everything else is ignoring input.
tldr; hierarchy your input controls into groups so you can ignore the input on inactive/not visible ones.