pub trait MenuNavigationStrategy {
// Required method
fn resolve_2d<'a>(
&self,
focused: Entity,
direction: Direction,
cycles: bool,
siblings: &'a [Entity],
) -> Option<&'a Entity>;
}
Expand description
System parameter used to resolve movement and cycling focus updates.
This is useful if you don’t want to depend
on bevy’s GlobalTransform
for your UI,
or want to implement your own navigation algorithm.
For example, if you want your ui to be 3d elements in the world.
Required Methods§
Sourcefn resolve_2d<'a>(
&self,
focused: Entity,
direction: Direction,
cycles: bool,
siblings: &'a [Entity],
) -> Option<&'a Entity>
fn resolve_2d<'a>( &self, focused: Entity, direction: Direction, cycles: bool, siblings: &'a [Entity], ) -> Option<&'a Entity>
Which Entity
in siblings
can be reached
from focused
in direction
if any, otherwise None
.
focused
: The currently focused entity in the menudirection
: The direction in which the focus should movecycles
: Whether the navigation should loopsibligns
: All the other focusable entities in this menu
Note that focused
appears once in siblings
.