Skip to content

Commit 83519da

Browse files
committed
Docs
1 parent b668171 commit 83519da

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

crates/bevy_sprite/src/bundle.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,14 @@ impl Default for SpriteBundle {
3030
}
3131

3232
/// A Bundle of components for drawing a single sprite from a sprite sheet (also referred
33-
/// to as a `TextureAtlas`)
33+
/// to as a `TextureAtlas`) or for animated sprites.
34+
///
35+
/// Note:
36+
/// This bundle is identical to [`SpriteBundle`] with an additional [`SpriteSheet`] component.
3437
#[derive(Bundle, Clone, Default)]
3538
pub struct SpriteSheetBundle {
3639
pub sprite: Sprite,
37-
/// The sprite sheet main texture
40+
/// The sprite sheet base texture
3841
pub texture: Handle<Image>,
3942
/// The sprite sheet texture atlas and the section to draw
4043
pub sheet: SpriteSheet,

crates/bevy_sprite/src/sprite.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@ pub struct Sprite {
2222
}
2323

2424
/// Component for sprite sheets containing a handle to [`TextureAtlas`] and the index of the current
25-
/// section of the sheet
25+
/// section of the sheet.
26+
///
27+
/// A texture atlas contains various *sections* or *cuts* of a given texture, allowing to have a single
28+
/// image file for sprite animation or various elements.
29+
/// You can change the [`index`](Self::index) of the sheet to animate the sprite or to pick a *section* of the texture.
30+
///
31+
/// You may check the following examples for usage:
32+
/// - [`animated sprite sheet example`](https://github.com/bevyengine/bevy/blob/main/examples/2d/sprite_sheet.rs)
33+
/// - [`texture atlas example`](https://github.com/bevyengine/bevy/blob/main/examples/2d/texture_atlas.rs)
2634
#[derive(Component, Default, Debug, Clone, Reflect)]
2735
pub struct SpriteSheet {
2836
/// Texture atlas handle

0 commit comments

Comments
 (0)