You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Objective
- Documenting changes to resolve#22305
- Update the release notes as a result of #22340
This is dependent on merging #22340 into 0.18!
**This is pointing to merge into release-0.18.0**, not main
@jbuehler23 FYI
Copy file name to clipboardExpand all lines: release-content/release-notes/automatic_directional_navigation.md
+30-10Lines changed: 30 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,16 @@
1
1
---
2
2
title: Automatic Directional Navigation
3
3
authors: ["@jbuehler23"]
4
-
pull_requests: [21668]
4
+
pull_requests: [21668, 22340]
5
5
---
6
6
7
-
Bevy now supports **automatic directional navigation graph generation** for UI elements! No more tedious manual wiring of navigation connections for your menus and UI screens.
7
+
Bevy now supports **automatic directional navigation** for UI elements! No more tedious manual wiring of navigation connections for your menus and UI screens.
8
8
9
9
## What's New?
10
10
11
11
Previously, creating directional navigation for UI required manually defining every connection between focusable elements using `DirectionalNavigationMap`. For dynamic UIs or complex layouts, this was time-consuming and error-prone.
12
12
13
-
Now, you can simply add the `AutoDirectionalNavigation` component to your UI entities, and Bevy will automatically compute navigation connections based on spatial positioning. The system intelligently finds the nearest neighbor in each of the 8 compass directions (North, Northeast, East, etc.), considering:
13
+
Now, you can simply add the `AutoDirectionalNavigation` component to your UI entities, and Bevy will automatically compute navigation connections based on spatial positioning. The system parameter intelligently finds the nearest neighbor in each of the 8 compass directions (North, Northeast, East, etc.), considering:
14
14
15
15
-**Distance**: Closer elements are preferred
16
16
-**Alignment**: Elements that are more directly in line with the navigation direction are favored
@@ -29,7 +29,17 @@ commands.spawn((
29
29
));
30
30
```
31
31
32
-
That's it! The `DirectionalNavigationPlugin` includes a system that automatically maintains the navigation graph as your UI changes.
32
+
To leverage automatic navigation, use the `AutoDirectionalNavigator` system parameter instead of the `DirectionalNavigation` system parameter:
Note: The automatic navigation system requires entities to have position and size information (`ComputedNode` and `UiGlobalTransform` for `bevy_ui` entities).
111
+
Note: Automatic navigation requires entities to have position and size information (`ComputedNode` and `UiGlobalTransform` for `bevy_ui` entities).
0 commit comments