bevy/examples/testbed
ickshonpe 1a18c9f87b
UI Debug Overlay show_hidden and show_clipped options (#17097)
# Objective

The UI debug overlay draws an outline for every UI node even if it is
invisible or clipped.
Disable debug outlines for hidden and clipped nodes by default and add
options to renable them if needed.

## Solution

* Add `show_hidden` and `show_clipped` fields to `UiDebugOptions`:
```rust
    /// Show outlines for non-visible UI nodes
    pub show_hidden: bool,
    /// Show outlines for clipped sections of UI nodes
    pub show_clipped: bool,
```

* Only extract debug outlines for hidden and clipped UI nodes if the
respective field in `UiDebugOptions` is set to `true`.

## Testing

Also added some extra features to the `testbed_ui` example that
demonstrate the new options:

cargo run --example testbed_ui --features "bevy_ui_debug"

<img width="641" alt="show-hidden-and-clipped"
src="https://github.com/user-attachments/assets/16a68600-170c-469e-a3c7-f7dae411dc40"
/>
2025-01-02 18:43:14 +00:00
..
2d.rs enable_state_scoped_entities() as a derive attribute (#16180) 2024-12-01 20:09:36 +00:00
3d.rs Feature flag testbed_3d code correctly (#16866) 2024-12-17 21:34:11 +00:00
ui_layout_rounding.rs UI anti-aliasing fix (#16181) 2024-11-13 21:41:02 +00:00
ui.rs UI Debug Overlay show_hidden and show_clipped options (#17097) 2025-01-02 18:43:14 +00:00