bevyengine / bevyengine/bevy

UI Extraction filtering

Open
#9,561 0 comments 0 reactions 0 assignees View on GitHub
A-Rendering A-UI C-Feature
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

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

At the moment if you add a custom UI extraction function there is no way to disable the built-in extraction, so you have to create new components and systems as well.

For example, imagine you want to create an `SdfTextPlugin` that renders text using SDFs. A naive implementation would add an `extract_sdf_text_uinodes` function to the extract schedule that queries for the text components and an `SdfText` marker component. But this won't work as the `extract_text_uinodes` function will find the same text components and the text will be extracted and rendered twice.

Instead, you would need to make `SdfText` into a newtype that wraps `Text` and reimplement all the text systems with queries for `SdfText` instead of `Text`, replicating hundreds of lines of code.

## What solution would you like?

Add marker components to all the UI node bundles that the extraction functions can filter on.
`Nodebundle` and `ImageBundle` would have `ExtractUiNode` and `ExtractUiNodeBorder` components, and `TextBundle` would also have an `ExtractUiNodeText`, etc.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.