(2022)
A generic UI navigation algorithm for the Bevy engine default UI library.
A 8 months effort to add gamepad navigation and an ergonomic event system to bevy’s UI library.
Bevy UI is very rough, without even the concept of an event. UI navigation is a design from first principle of an ECS-native UI navigation system, specifically integrating both gamepad and mouse input.
It was first designed as ad-hoc implementation independent from the ECS. However, navigation relying heavily on two-way tree data structures, a notoriously challenging data structure to model in Rust, the bevy ECS became an major part of the implementation.
It was first implemented as a pure design document RFC, then as a 3rd party crate, which learnings guided improvements on the RFC. There is now an actual PR as a first party Bevy implementation.
The current blocking issue is integrated handling of both mouse hover and gamepad focus state.