Skip to content

Commit

Permalink
Clarify index order in TextureAtlas::from_grid (bevyengine#6058)
Browse files Browse the repository at this point in the history
# Objective

Docs on from_grid/from_grid_with_padding aren't clear on indexing order.

## Solution

Make the docs better!
  • Loading branch information
pcone committed Sep 22, 2022
1 parent 527dce9 commit e668b47
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/bevy_sprite/src/texture_atlas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ impl TextureAtlas {
}

/// Generate a `TextureAtlas` by splitting a texture into a grid where each
/// `tile_size` by `tile_size` grid-cell is one of the textures in the atlas
/// `tile_size` by `tile_size` grid-cell is one of the textures in the
/// atlas. Resulting `TextureAtlas` is indexed left to right, top to bottom.
pub fn from_grid(
texture: Handle<Image>,
tile_size: Vec2,
Expand All @@ -81,7 +82,8 @@ impl TextureAtlas {
/// Generate a `TextureAtlas` by splitting a texture into a grid where each
/// `tile_size` by `tile_size` grid-cell is one of the textures in the
/// atlas. Grid cells are separated by some `padding`, and the grid starts
/// at `offset` pixels from the top left corner.
/// at `offset` pixels from the top left corner. Resulting `TextureAtlas` is
/// indexed left to right, top to bottom.
pub fn from_grid_with_padding(
texture: Handle<Image>,
tile_size: Vec2,
Expand Down

0 comments on commit e668b47

Please sign in to comment.