Skip to content

bevy_input_focus: Support for navigation in arbitrary directions #22233

@ickshonpe

Description

@ickshonpe

What problem does this solve or what need does it fill?

At the moment directional navigation only supports navigation in eight directions using the CompassOctant enum.
But games often have have skill trees and radial menus navigable with analogue sticks in more than eight directions.
Hexagonal maps are also common in games and five directional navigation doesn't map well onto CompassOctant.

What solution would you like?

The neighbours map should support any number of destinations, perhaps by holding a map from a set of disjoint direction ranges to neighbours. Then given a Dir2 it would find the containing range and map it to a destination.

The API could still allow use of CompassOctant but it would be mapped internally to Dir2s.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-UIGraphical user interfaces, styles, layouts, and widgetsC-FeatureA new feature, making something new possible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions