Skip to content

Commit eec39ab

Browse files
pconeItsDoot
authored andcommitted
Clarify index order in TextureAtlas::from_grid (bevyengine#6058)
# Objective Docs on from_grid/from_grid_with_padding aren't clear on indexing order. ## Solution Make the docs better!
1 parent 4bf0b6c commit eec39ab

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/bevy_sprite/src/texture_atlas.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ impl TextureAtlas {
6868
}
6969

7070
/// Generate a `TextureAtlas` by splitting a texture into a grid where each
71-
/// `tile_size` by `tile_size` grid-cell is one of the textures in the atlas
71+
/// `tile_size` by `tile_size` grid-cell is one of the textures in the
72+
/// atlas. Resulting `TextureAtlas` is indexed left to right, top to bottom.
7273
pub fn from_grid(
7374
texture: Handle<Image>,
7475
tile_size: Vec2,
@@ -81,7 +82,8 @@ impl TextureAtlas {
8182
/// Generate a `TextureAtlas` by splitting a texture into a grid where each
8283
/// `tile_size` by `tile_size` grid-cell is one of the textures in the
8384
/// atlas. Grid cells are separated by some `padding`, and the grid starts
84-
/// at `offset` pixels from the top left corner.
85+
/// at `offset` pixels from the top left corner. Resulting `TextureAtlas` is
86+
/// indexed left to right, top to bottom.
8587
pub fn from_grid_with_padding(
8688
texture: Handle<Image>,
8789
tile_size: Vec2,

0 commit comments

Comments
 (0)