mirror of
https://github.com/bevyengine/bevy
synced 2024-11-21 20:23:28 +00:00
79e73738c7
# Objective Make UI rendering optional. Quite a few people have been experimenting with using Bevy UI for layout and interaction but replacing the rendering with `bevy_prototype_lyon` or whatever. It's awkward to do though as there is no way to disable the existing UI rendering requiring users to create their own custom node bundles and components. Also, you can't replace the UI's shader and a number of other things. This PR makes the setup and initialization of UI rendering for the RenderApp optional. Then you can do whatever you want by replacing `build_ui_render` with your own function. For instance, one that loads a custom shader. The UI layout and interaction components are still updated as normal. ## Solution Add a field `enable_rendering` to `UiPlugin`. Only call `build_ui_render` and initialize the `UiPipeline` if `enable_rendering` is false. I thought about implementing a "bevy_ui_render" feature but suspect everything is too tightly coupled atm and it would be very fragile. Similar to the struggles with the "bevy_text" feature but worse. --- ## Changelog `UiPlugin` * Added a bool field `enable_rendering`. * Only calls `build_ui_render` and initializes the `UiPipeline` if `enable_rendering` is true. ## Migration Guide `UiPlugin` has a new field `enable_rendering`. If set to false, the UI's rendering systems won't be added to the `RenderApp` and no UI elements will be drawn. The layout and interaction components will still be updated as normal. |
||
---|---|---|
.. | ||
bevy_a11y | ||
bevy_animation | ||
bevy_app | ||
bevy_asset | ||
bevy_audio | ||
bevy_color | ||
bevy_core | ||
bevy_core_pipeline | ||
bevy_derive | ||
bevy_dev_tools | ||
bevy_diagnostic | ||
bevy_dylib | ||
bevy_ecs | ||
bevy_encase_derive | ||
bevy_gilrs | ||
bevy_gizmos | ||
bevy_gltf | ||
bevy_hierarchy | ||
bevy_image | ||
bevy_input | ||
bevy_internal | ||
bevy_log | ||
bevy_macro_utils | ||
bevy_math | ||
bevy_mesh | ||
bevy_mikktspace | ||
bevy_pbr | ||
bevy_picking | ||
bevy_ptr | ||
bevy_reflect | ||
bevy_remote | ||
bevy_render | ||
bevy_scene | ||
bevy_sprite | ||
bevy_state | ||
bevy_tasks | ||
bevy_text | ||
bevy_time | ||
bevy_transform | ||
bevy_ui | ||
bevy_utils | ||
bevy_window | ||
bevy_winit |