forked from bevyengine/bevy
-
Notifications
You must be signed in to change notification settings - Fork 0
[pull] main from bevyengine:main #178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Objective - Add a few useful methods to `TextureAtlas`. ## Solution - Added `TextureAtlas::with_index()`. - Added `TextureAtlas::with_layout()`. ## Testing - CI checks.
# Objective Add background colors for text. Fixes #18889 ## Solution New component `TextBackgroundColor`, add it to any UI `Text` or `TextSpan` entity to add a background color to its text. New field on `TextLayoutInfo` `section_rects` holds the list of bounding rects for each text section. The bounding rects are generated in `TextPipeline::queue_text` during text layout, `extract_text_background_colors` extracts the colored background rects for rendering. Didn't include `Text2d` support because of z-order issues. The section rects can also be used to implement interactions targeting individual text sections. ## Testing Includes a basic example that can be used for testing: ``` cargo run --example text_background_colors ``` --- ## Showcase  Using a proportional font with kerning the results aren't so tidy (since the bounds of adjacent glyphs can overlap) but it still works fine:  --------- Co-authored-by: Olle Lukowski <lukowskiolle@gmail.com> Co-authored-by: Gilles Henaux <ghx_github_priv@fastmail.com>
# Objective - If using a `NonNilUuid` in Bevy, it's difficult to reflect it. ## Solution - Adds `NonNilUuid` using `impl_reflect_opaque!`. ## Testing - Built with no issues found locally. - Essentially the same as the `Uuid` support except without `Default`. Co-authored-by: TM Storey <mail@tmstorey.id.au>
# Objective Refactor [`examples/ui/borders.rs`](https://github.com/bevyengine/bevy/blob/7f0490655c3ede945e6babc1f1a1f06b13404aa8/examples/ui/borders.rs) to use the new spawning/hierarchy APIs in 0.16. ## Solution This refactor reduces the number of `.spawn` calls from about 16 to 2, using one spawn for each major feature: * camera2d * ui layout The `Children::spawn` relationship API is used to take advantage of `SpawnIter` for the borders examples in each block. Each block of examples now returns a Bundle into its respective variable, which is then used in combination with the new `label` widget which makes use of the new `impl Bundle` return capability. This allows the ui layout to use a single `.spawn` with the `children!` macro. The blocks of examples are still in separate variables because it felt like a useful way to organize it still, even without needing to spawn at those locations. Functionality of the demo hasn't changed, this is just an API/code update. ## Showcase  <details> <summary>Before screenshot</summary>  </details> --------- Co-authored-by: François Mockers <mockersf@gmail.com>
…alidation (#18765) # Objective Create a `When` system param wrapper for skipping systems that fail validation. Currently, the `Single` and `Populated` parameters cause systems to skip when they fail validation, while the `Res` family causes systems to error. Generalize this so that any fallible parameter can be used either to skip a system or to raise an error. A parameter used directly will always raise an error, and a parameter wrapped in `When<P>` will always cause the system to be silently skipped. ~~Note that this changes the behavior for `Single` and `Populated`. The current behavior will be available using `When<Single>` and `When<Populated>`.~~ Fixes #18516 ## Solution Create a `When` system param wrapper that wraps an inner parameter and converts all validation errors to `skipped`. ~~Change the behavior of `Single` and `Populated` to fail by default.~~ ~~Replace in-engine use of `Single` with `When<Single>`. I updated the `fallible_systems` example, but not all of the others. The other examples I looked at appeared to always have one matching entity, and it seemed more clear to use the simpler type in those cases.~~ --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com> Co-authored-by: Zachary Harrold <zac@harrold.com.au> Co-authored-by: François Mockers <mockersf@gmail.com>
# Objective `BTreeSet` doesn't implement `RelationshipSourceCollection`. ## Solution Implement it. ## Testing `cargo clippy` --- ## Showcase You can now use `BTreeSet` in a `RelationshipTarget` --------- Co-authored-by: Chris Russell <8494645+chescock@users.noreply.github.com> Co-authored-by: François Mockers <mockersf@gmail.com>
# Objective `IndexSet` doesn't implement `RelationshipSourceCollection` ## Solution Implement `MapEntities` for `IndexSet` Implement `RelationshipSourceCollection` for `IndexSet` ## Testing `cargo clippy` --------- Co-authored-by: François Mockers <mockersf@gmail.com> Co-authored-by: François Mockers <francois.mockers@vleue.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.1)
Can you help keep this open source service alive? 💖 Please sponsor : )