Skip to content

Commit 7b217a9

Browse files
authored
Remove deprecated SpriteSheetBundle and AtlasImageBundle (#15062)
# Objective Remove bundles that were deprecated in 0.14. ## Testing `rg SpriteSheetBundle` and `rg AtlasImageBundle` show no results.
1 parent 3d30b0f commit 7b217a9

File tree

3 files changed

+4
-97
lines changed

3 files changed

+4
-97
lines changed

crates/bevy_sprite/src/bundle.rs

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#![allow(deprecated)]
2-
3-
use crate::{Sprite, TextureAtlas};
1+
use crate::Sprite;
42
use bevy_asset::Handle;
53
use bevy_ecs::bundle::Bundle;
64
use bevy_render::{
@@ -15,7 +13,7 @@ use bevy_transform::components::{GlobalTransform, Transform};
1513
///
1614
/// You may add one or both of the following components to enable additional behaviours:
1715
/// - [`ImageScaleMode`](crate::ImageScaleMode) to enable either slicing or tiling of the texture
18-
/// - [`TextureAtlas`] to draw a specific section of the texture
16+
/// - [`TextureAtlas`](crate::TextureAtlas) to draw a specific section of the texture
1917
#[derive(Bundle, Clone, Debug, Default)]
2018
pub struct SpriteBundle {
2119
/// Specifies the rendering properties of the sprite, such as color tint and flip.
@@ -33,37 +31,3 @@ pub struct SpriteBundle {
3331
/// Algorithmically-computed indication of whether an entity is visible and should be extracted for rendering
3432
pub view_visibility: ViewVisibility,
3533
}
36-
37-
/// A [`Bundle`] of components for drawing a single sprite from a sprite sheet (also referred
38-
/// to as a `TextureAtlas`) or for animated sprites.
39-
///
40-
/// Note:
41-
/// This bundle is identical to [`SpriteBundle`] with an additional [`TextureAtlas`] component.
42-
///
43-
/// Check the following examples for usage:
44-
/// - [`animated sprite sheet example`](https://github.com/bevyengine/bevy/blob/latest/examples/2d/sprite_sheet.rs)
45-
/// - [`sprite animation event example`](https://github.com/bevyengine/bevy/blob/latest/examples/2d/sprite_animation.rs)
46-
/// - [`texture atlas example`](https://github.com/bevyengine/bevy/blob/latest/examples/2d/texture_atlas.rs)
47-
#[deprecated(
48-
since = "0.14.0",
49-
note = "Use `TextureAtlas` alongside a `SpriteBundle` instead"
50-
)]
51-
#[derive(Bundle, Clone, Debug, Default)]
52-
pub struct SpriteSheetBundle {
53-
/// Specifies the rendering properties of the sprite, such as color tint and flip.
54-
pub sprite: Sprite,
55-
/// The local transform of the sprite, relative to its parent.
56-
pub transform: Transform,
57-
/// The absolute transform of the sprite. This should generally not be written to directly.
58-
pub global_transform: GlobalTransform,
59-
/// The sprite sheet base texture
60-
pub texture: Handle<Image>,
61-
/// The sprite sheet texture atlas, allowing to draw a custom section of `texture`.
62-
pub atlas: TextureAtlas,
63-
/// User indication of whether an entity is visible
64-
pub visibility: Visibility,
65-
/// Inherited visibility of an entity.
66-
pub inherited_visibility: InheritedVisibility,
67-
/// Algorithmically-computed indication of whether an entity is visible and should be extracted for rendering
68-
pub view_visibility: ViewVisibility,
69-
}

crates/bevy_sprite/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ mod texture_slice;
2323
///
2424
/// This includes the most common types in this crate, re-exported for your convenience.
2525
pub mod prelude {
26-
#[allow(deprecated)]
27-
#[doc(hidden)]
28-
pub use crate::bundle::SpriteSheetBundle;
29-
3026
#[doc(hidden)]
3127
pub use crate::{
3228
bundle::SpriteBundle,

crates/bevy_ui/src/node_bundles.rs

Lines changed: 2 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(deprecated)]
2-
31
//! This module contains basic node bundles used to build UIs
42
53
#[cfg(feature = "bevy_text")]
@@ -14,7 +12,6 @@ use bevy_asset::Handle;
1412
use bevy_color::Color;
1513
use bevy_ecs::bundle::Bundle;
1614
use bevy_render::view::{InheritedVisibility, ViewVisibility, Visibility};
17-
use bevy_sprite::TextureAtlas;
1815
#[cfg(feature = "bevy_text")]
1916
use bevy_text::{
2017
BreakLineOn, CosmicBuffer, JustifyText, Text, TextLayoutInfo, TextSection, TextStyle,
@@ -67,7 +64,7 @@ pub struct NodeBundle {
6764
///
6865
/// You may add one or both of the following components to enable additional behaviours:
6966
/// - [`ImageScaleMode`](bevy_sprite::ImageScaleMode) to enable either slicing or tiling of the texture
70-
/// - [`TextureAtlas`] to draw a specific section of the texture
67+
/// - [`TextureAtlas`](bevy_sprite::TextureAtlas) to draw a specific section of the texture
7168
#[derive(Bundle, Debug, Default)]
7269
pub struct ImageBundle {
7370
/// Describes the logical size of the node
@@ -110,56 +107,6 @@ pub struct ImageBundle {
110107
pub z_index: ZIndex,
111108
}
112109

113-
/// A UI node that is a texture atlas sprite
114-
///
115-
/// # Extra behaviours
116-
///
117-
/// You may add the following components to enable additional behaviours
118-
/// - [`ImageScaleMode`](bevy_sprite::ImageScaleMode) to enable either slicing or tiling of the texture
119-
///
120-
/// This bundle is identical to [`ImageBundle`] with an additional [`TextureAtlas`] component.
121-
#[deprecated(
122-
since = "0.14.0",
123-
note = "Use `TextureAtlas` alongside `ImageBundle` instead"
124-
)]
125-
#[derive(Bundle, Debug, Default)]
126-
pub struct AtlasImageBundle {
127-
/// Describes the logical size of the node
128-
pub node: Node,
129-
/// Styles which control the layout (size and position) of the node and its children
130-
/// In some cases these styles also affect how the node drawn/painted.
131-
pub style: Style,
132-
/// The calculated size based on the given image
133-
pub calculated_size: ContentSize,
134-
/// The image of the node
135-
pub image: UiImage,
136-
/// A handle to the texture atlas to use for this Ui Node
137-
pub texture_atlas: TextureAtlas,
138-
/// Whether this node should block interaction with lower nodes
139-
pub focus_policy: FocusPolicy,
140-
/// The size of the image in pixels
141-
///
142-
/// This component is set automatically
143-
pub image_size: UiImageSize,
144-
/// The transform of the node
145-
///
146-
/// This component is automatically managed by the UI layout system.
147-
/// To alter the position of the `AtlasImageBundle`, use the properties of the [`Style`] component.
148-
pub transform: Transform,
149-
/// The global transform of the node
150-
///
151-
/// This component is automatically updated by the [`TransformPropagate`](`bevy_transform::TransformSystem::TransformPropagate`) systems.
152-
pub global_transform: GlobalTransform,
153-
/// Describes the visibility properties of the node
154-
pub visibility: Visibility,
155-
/// Inherited visibility of an entity.
156-
pub inherited_visibility: InheritedVisibility,
157-
/// Algorithmically-computed indication of whether an entity is visible and should be extracted for rendering
158-
pub view_visibility: ViewVisibility,
159-
/// Indicates the depth at which the node should appear in the UI
160-
pub z_index: ZIndex,
161-
}
162-
163110
#[cfg(feature = "bevy_text")]
164111
/// A UI node that is text
165112
///
@@ -269,7 +216,7 @@ where
269216
///
270217
/// You may add one or both of the following components to enable additional behaviours:
271218
/// - [`ImageScaleMode`](bevy_sprite::ImageScaleMode) to enable either slicing or tiling of the texture
272-
/// - [`TextureAtlas`] to draw a specific section of the texture
219+
/// - [`TextureAtlas`](bevy_sprite::TextureAtlas) to draw a specific section of the texture
273220
#[derive(Bundle, Clone, Debug)]
274221
pub struct ButtonBundle {
275222
/// Describes the logical size of the node

0 commit comments

Comments
 (0)