Provide an ability to define custom bound checking for UI element interaction
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
## What problem does this solve or what need does it fill?
Sometimes UI elements might not be rectangular, for example - hexagonal. In such case it would be beneficial if there would be a possibility to have a custom bound checking function to be defined, so that such UI elements could work within the scope of general `ui_focus_system`.
This also includes handling events like `hover` on UI elements with different styling like rotation.
## What solution would you like?
Perhaps, we could provide a component that would contain bound-checking function. This would work for cases where bound checking does not require external information and could be calculated based on `transform` and/or `position`.
No idea how it could be implemented for more generic/complicated bound checking functions that rely on some game state.
## What alternative(s) have you considered?
Another solution would be marking "special" UI elements to be exempt from being handled by internal `ui_focus_system`.
And instead delegate responsibility for doing interactivity in such cases to developers.
Howevers, this approach makes it questionable on how to handle focus policy accross UI.
## Additional context
#5179 - is likely connected issue with this one (they originated from the same conversation).
Contributor guide
Assessment
This issue has not been assessed yet.