Skip to content
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

Deprecate SpriteSheetBundle and AtlasImageBundle #12218

Merged
merged 5 commits into from
Mar 3, 2024

Conversation

benfrankel
Copy link
Contributor

@benfrankel benfrankel commented Mar 1, 2024

Objective

After the TextureAtlas changes that landed in 0.13, SpriteSheetBundle is equivalent to TextureAtlas + SpriteBundle and AtlasImageBundle is equivalent to TextureAtlas + ImageBundle. As such, the atlas bundles aren't particularly useful / necessary additions to the API anymore.

In addition, atlas bundles are inconsistent with ImageScaleMode (also introduced in 0.13) which doesn't have its own version of each image bundle.

Solution

Deprecate SpriteSheetBundle and AtlasImageBundle in favor of including TextureAtlas as a separate component alongside SpriteBundle and ImageBundle, respectively.


Changelog

  • Deprecated SpriteSheetBundle and AtlasImageBundle.

Migration Guide

  • SpriteSheetBundle has been deprecated. Use TextureAtlas alongside a SpriteBundle instead.
  • AtlasImageBundle has been deprecated. Use TextureAtlas alongside an ImageBundle instead.

@benfrankel benfrankel changed the title Deprecate AtlasImageBundle and SpriteSheetBundle Deprecate SpriteSheetBundle and AtlasImageBundle Mar 1, 2024
@benfrankel
Copy link
Contributor Author

Had to add #[allow(deprecated)] because Rust was generating spurious warnings about e.g. deprecated AtlasImageBundle being "used" at the line where it's defined. Weird.

@TrialDragon TrialDragon added the A-UI Graphical user interfaces, styles, layouts, and widgets label Mar 1, 2024
Copy link
Contributor

@wilk10 wilk10 left a comment

Choose a reason for hiding this comment

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

Thanks a lot! I am in favour of this. I just left a couple of comments about the documentation.

crates/bevy_sprite/src/bundle.rs Show resolved Hide resolved
crates/bevy_sprite/src/bundle.rs Show resolved Hide resolved
crates/bevy_ui/src/node_bundles.rs Show resolved Hide resolved
@alice-i-cecile alice-i-cecile added this to the 0.14 milestone Mar 1, 2024
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Mar 1, 2024
Copy link
Contributor

@wilk10 wilk10 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks a lot for working on this!

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Mar 3, 2024
@james7132 james7132 added this pull request to the merge queue Mar 3, 2024
Merged via the queue into bevyengine:main with commit 6e83439 Mar 3, 2024
26 checks passed
@benfrankel benfrankel deleted the deprecate-bundles branch March 5, 2024 01:02
spectria-limina pushed a commit to spectria-limina/bevy that referenced this pull request Mar 9, 2024
# Objective

After the `TextureAtlas` changes that landed in 0.13,
`SpriteSheetBundle` is equivalent to `TextureAtlas` + `SpriteBundle` and
`AtlasImageBundle` is equivalent to `TextureAtlas` + `ImageBundle`. As
such, the atlas bundles aren't particularly useful / necessary additions
to the API anymore.

In addition, atlas bundles are inconsistent with `ImageScaleMode` (also
introduced in 0.13) which doesn't have its own version of each image
bundle.

## Solution

Deprecate `SpriteSheetBundle` and `AtlasImageBundle` in favor of
including `TextureAtlas` as a separate component alongside
`SpriteBundle` and `ImageBundle`, respectively.

---

## Changelog

- Deprecated `SpriteSheetBundle` and `AtlasImageBundle`.

## Migration Guide

- `SpriteSheetBundle` has been deprecated. Use `TextureAtlas` alongside
a `SpriteBundle` instead.
- `AtlasImageBundle` has been deprecated. Use `TextureAtlas` alongside
an `ImageBundle` instead.
@alice-i-cecile alice-i-cecile added the M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide label Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen A-UI Graphical user interfaces, styles, layouts, and widgets C-Usability A targeted quality-of-life change that makes Bevy easier to use M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide 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.

5 participants