bevy/crates/bevy_sprite
FraserLee 575ffa7c0c Added offset parameter to TextureAtlas::from_grid_with_padding (#4836)
# Objective
Increase compatibility with a fairly common format of padded spritesheets, in which half the padding value occurs before the first sprite box begins. The original behaviour falls out when `Vec2::ZERO` is used for `offset`.

See below unity screenshot for an example of a spritesheet with padding

![Screen Shot 2022-05-24 at 4 11 49 PM](https://user-images.githubusercontent.com/30442265/170123682-287e5733-b69d-452b-b2e6-46d8d29293fb.png)

## Solution
Tiny change to `crates/bevy_sprite/src/texture_atlas.rs`

## Migration Guide

Calls to `TextureAtlas::from_grid_with_padding` should be modified to include a new parameter, which can be set to `Vec2::ZERO` to retain old behaviour.
```rust
from_grid_with_padding(texture, tile_size, columns, rows, padding)
                                  |
                                  V
from_grid_with_padding(texture, tile_size, columns, rows, padding, Vec2::ZERO)
```


Co-authored-by: FraserLee <30442265+FraserLee@users.noreply.github.com>
2022-05-30 19:58:16 +00:00
..
src Added offset parameter to TextureAtlas::from_grid_with_padding (#4836) 2022-05-30 19:58:16 +00:00
Cargo.toml Move float_ord from bevy_core to bevy_utils (#4189) 2022-04-27 18:02:05 +00:00