docs: add hint that texture atlas padding is between tiles (#2447)

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.
This commit is contained in:
Gilbert Röhrbein 2021-07-12 20:29:28 +00:00
parent 57c021538e
commit 10b0b1ad40

View file

@ -112,7 +112,8 @@ impl TextureAtlas {
/// Generate a `TextureAtlas` by splitting a texture into a grid where each /// 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 /// 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( pub fn from_grid_with_padding(
texture: Handle<Texture>, texture: Handle<Texture>,
tile_size: Vec2, tile_size: Vec2,