bevy/crates
mgi388 e24ae6cf40
Move TextureAtlas and friends into bevy_image (#17219)
# Objective

- Allow other crates to use `TextureAtlas` and friends without needing
to depend on `bevy_sprite`.
- Specifically, this allows adding `TextureAtlas` support to custom
cursors in https://github.com/bevyengine/bevy/pull/17121 by allowing
`bevy_winit` to depend on `bevy_image` instead of `bevy_sprite` which is
a [non-starter].

[non-starter]:
https://github.com/bevyengine/bevy/pull/17121#discussion_r1904955083

## Solution

- Move `TextureAtlas`, `TextureAtlasBuilder`, `TextureAtlasSources`,
`TextureAtlasLayout` and `DynamicTextureAtlasBuilder` into `bevy_image`.
- Add a new plugin to `bevy_image` named `TextureAtlasPlugin` which
allows us to register `TextureAtlas` and `TextureAtlasLayout` which was
previously done in `SpritePlugin`. Since `SpritePlugin` did the
registration previously, we just need to make it add
`TextureAtlasPlugin`.

## Testing

- CI builds it.
- I also ran multiple examples which hopefully covered any issues:

```
$ cargo run --example sprite
$ cargo run --example text
$ cargo run --example ui_texture_atlas
$ cargo run --example sprite_animation
$ cargo run --example sprite_sheet
$ cargo run --example sprite_picking
```

---

## Migration Guide

The following types have been moved from `bevy_sprite` to `bevy_image`:
`TextureAtlas`, `TextureAtlasBuilder`, `TextureAtlasSources`,
`TextureAtlasLayout` and `DynamicTextureAtlasBuilder`.

If you are using the `bevy` crate, and were importing these types
directly (e.g. before `use bevy::sprite::TextureAtlas`), be sure to
update your import paths (e.g. after `use bevy::image::TextureAtlas`)

If you are using the `bevy` prelude to import these types (e.g. `use
bevy::prelude::*`), you don't need to change anything.

If you are using the `bevy_sprite` subcrate, be sure to add `bevy_image`
as a dependency if you do not already have it, and be sure to update
your import paths.
2025-01-07 18:43:11 +00:00
..
bevy_a11y Update all previously-merged #![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)] attributes to include a reason field pointing to the tracking issue (#17136) 2025-01-06 05:40:08 +00:00
bevy_animation Update all previously-merged #![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)] attributes to include a reason field pointing to the tracking issue (#17136) 2025-01-06 05:40:08 +00:00
bevy_app Fix depth_bias and build errors on less capable platforms (#17079) 2025-01-06 18:39:08 +00:00
bevy_asset bevy_asset: Apply #![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)] (#17113) 2025-01-06 19:25:47 +00:00
bevy_audio bevy_audio: Apply #![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)] (#17119) 2025-01-06 19:09:08 +00:00
bevy_color Add the original source for Oklab conversions (#17199) 2025-01-07 00:41:33 +00:00
bevy_core_pipeline Remove bevy_core_pipeline::core_2d::Camera2dBundle (#17185) 2025-01-06 19:29:14 +00:00
bevy_derive Bump Version after Release (#17176) 2025-01-06 00:04:44 +00:00
bevy_dev_tools Upstream DebugPickingPlugin from bevy_mod_picking (#17177) 2025-01-07 05:19:50 +00:00
bevy_diagnostic bevy_diagnostic: Apply #![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)] (#17186) 2025-01-06 19:29:59 +00:00
bevy_dylib Bump Version after Release (#17176) 2025-01-06 00:04:44 +00:00
bevy_ecs Add Result handling to Commands and EntityCommands (#17043) 2025-01-07 16:50:52 +00:00
bevy_encase_derive Bump Version after Release (#17176) 2025-01-06 00:04:44 +00:00
bevy_gilrs Bump Version after Release (#17176) 2025-01-06 00:04:44 +00:00
bevy_gizmos Bump Version after Release (#17176) 2025-01-06 00:04:44 +00:00
bevy_gltf Bump Version after Release (#17176) 2025-01-06 00:04:44 +00:00
bevy_hierarchy Add Result handling to Commands and EntityCommands (#17043) 2025-01-07 16:50:52 +00:00
bevy_image Move TextureAtlas and friends into bevy_image (#17219) 2025-01-07 18:43:11 +00:00
bevy_input Bump Version after Release (#17176) 2025-01-06 00:04:44 +00:00
bevy_input_focus Reflect bevy_input_focus (#17212) 2025-01-07 18:16:46 +00:00
bevy_internal Move TextureAtlas and friends into bevy_image (#17219) 2025-01-07 18:43:11 +00:00
bevy_log Bump Version after Release (#17176) 2025-01-06 00:04:44 +00:00
bevy_macro_utils Bump Version after Release (#17176) 2025-01-06 00:04:44 +00:00
bevy_math Add basic directional (gamepad) navigation for UI (and non-UI) (#17102) 2025-01-06 18:51:44 +00:00
bevy_mesh Bump Version after Release (#17176) 2025-01-06 00:04:44 +00:00
bevy_mikktspace Bump Version after Release (#17176) 2025-01-06 00:04:44 +00:00
bevy_pbr Remove references to old sample_texture function (#17195) 2025-01-07 00:44:17 +00:00
bevy_picking Bump Version after Release (#17176) 2025-01-06 00:04:44 +00:00
bevy_ptr Bump Version after Release (#17176) 2025-01-06 00:04:44 +00:00
bevy_reflect Fix depth_bias and build errors on less capable platforms (#17079) 2025-01-06 18:39:08 +00:00
bevy_remote Bump Version after Release (#17176) 2025-01-06 00:04:44 +00:00
bevy_render bevy_render: Apply #![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)] (#17194) 2025-01-06 23:10:58 +00:00
bevy_scene Bump Version after Release (#17176) 2025-01-06 00:04:44 +00:00
bevy_sprite Move TextureAtlas and friends into bevy_image (#17219) 2025-01-07 18:43:11 +00:00
bevy_state Bump Version after Release (#17176) 2025-01-06 00:04:44 +00:00
bevy_tasks Update all previously-merged #![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)] attributes to include a reason field pointing to the tracking issue (#17136) 2025-01-06 05:40:08 +00:00
bevy_text Move TextureAtlas and friends into bevy_image (#17219) 2025-01-07 18:43:11 +00:00
bevy_time Bump Version after Release (#17176) 2025-01-06 00:04:44 +00:00
bevy_transform Bump Version after Release (#17176) 2025-01-06 00:04:44 +00:00
bevy_ui Move TextureAtlas and friends into bevy_image (#17219) 2025-01-07 18:43:11 +00:00
bevy_utils Bump Version after Release (#17176) 2025-01-06 00:04:44 +00:00
bevy_window can hide status bar on iOS (#17179) 2025-01-06 19:19:56 +00:00
bevy_winit iOS: can change home indicator / status bar during runtime (#17204) 2025-01-07 01:07:18 +00:00