Skip to content

Commit

Permalink
docs: add hint that texture atlas padding is between tiles (#2447)
Browse files Browse the repository at this point in the history
I struggled with some sprite sheet animation which was like drifting from right to left.
This PR documents the current behaviour that the padding which is used on slicing a texture into a texture atlas, is assumed to be only between tiles. In my case I had some padding also on the right side of the texture.
  • Loading branch information
payload committed Jul 12, 2021
1 parent 57c0215 commit 10b0b1a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/bevy_sprite/src/texture_atlas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ impl TextureAtlas {

/// Generate a `TextureAtlas` by splitting a texture into a grid where each
/// cell of the grid of `tile_size` is one of the textures in the atlas and is separated by
/// some `padding` in the texture
/// some `padding` in the texture. The padding is assumed to be only between tiles
/// and not at the borders of the texture.
pub fn from_grid_with_padding(
texture: Handle<Texture>,
tile_size: Vec2,
Expand Down

0 comments on commit 10b0b1a

Please sign in to comment.