Skip to content

Commit 7d83aa2

Browse files
committed
docs: updates release notes based on dependency rearrangement
1 parent 628f6d4 commit 7d83aa2

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

release-content/release-notes/automatic_directional_navigation.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Automatic Directional Navigation
33
authors: ["@jbuehler23"]
4-
pull_requests: [21668]
4+
pull_requests: [21668, 22340]
55
---
66

77
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.
@@ -29,7 +29,9 @@ commands.spawn((
2929
));
3030
```
3131

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.
33+
34+
That's it! The `DirectionalNavigationPlugin` will set up the resources that `AutoDirectionalNavigator` uses to function.
3335

3436
### Configuration
3537

@@ -77,6 +79,15 @@ directional_nav_map.add_edges(&column_entities, CompassOctant::South);
7779
// ... repeat for all rows and columns
7880
```
7981

82+
```rust
83+
// Use the DirectionalNavigation SystemParam to navigate in your system
84+
fn navigation_system(mut directional_navigation: DirectionalNavigation) {
85+
// ...
86+
directional_navigation.navigate(CompassOctant::East);
87+
// ...
88+
}
89+
```
90+
8091
**After:**
8192

8293
```rust
@@ -88,4 +99,13 @@ commands.spawn((
8899
));
89100
```
90101

102+
```rust
103+
// Use the AutoDirectionalNavigator SystemParam to navigate
104+
fn navigation_system(mut auto_directional_navigator: AutoDirectionalNavigator) {
105+
// ...
106+
auto_directional_navigator.navigate(CompassOctant::East);
107+
// ...
108+
}
109+
```
110+
91111
Note: The automatic navigation system requires entities to have position and size information (`ComputedNode` and `UiGlobalTransform` for `bevy_ui` entities).

0 commit comments

Comments
 (0)