Skip to content

Conversation

@krunchington
Copy link
Contributor

@krunchington krunchington commented Mar 15, 2025

Objective

Contributes to #18238
Updates the text2d, example to use the children! macro.

The SpawnIter usage in this example is maybe not the best. Very open to opinions. I even left one with_children that I thought was just much better than any alternative.

Solution

Updates examples to use the Improved Spawning API merged in #17521

Testing

  • Did you test these changes? If so, how?
    • Opened the examples before and after and verified the same behavior was observed. I did this on Ubuntu 24.04.2 LTS using --features wayland.
  • Are there any parts that need more testing?
    • Other OS's and features can't hurt, but this is such a small change it shouldn't be a problem.
  • How can other people (reviewers) test your changes? Is there anything specific they need to know?
    • Run the examples yourself with and without these changes.
  • If relevant, what platforms did you test these changes on, and are there any important ones you can't test?
    • see above

Showcase

n/a

Migration Guide

n/a

for (size, offset, spread, blur, border_radius) in example_nodes {
commands.spawn((
]
.into_iter()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty neutral on this change.

Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I might revert the SpawnIter changes back to .with_children, but I like the straightforward children! macro usage. Overall, I think this is a mild improvment.

@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events C-Examples An addition or correction to our examples D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Mar 16, 2025
@krunchington
Copy link
Contributor Author

SpawnIter changes reverted, leaving only the one (nested) children change which felt decent.

@mnmaita mnmaita added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Mar 21, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Mar 21, 2025
Merged via the queue into bevyengine:main with commit 9ae7aa4 Mar 21, 2025
32 checks passed
@krunchington krunchington deleted the issue/18238-0315-1 branch March 22, 2025 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ECS Entities, components, systems, and events C-Examples An addition or correction to our examples D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants