bevy/crates/bevy_sprite/src
Boutillier b91945b54d Merge TextureAtlas::from_grid_with_padding into TextureAtlas::from_grid through option arguments (#6057)
This is an adoption of #3775
This merges `TextureAtlas` `from_grid_with_padding` into `from_grid` , adding optional padding and optional offset.
Since the orignal PR, the offset had already been added to from_grid_with_padding through #4836 

## Changelog

- Added `padding` and `offset` arguments to  `TextureAtlas::from_grid`
- Removed `TextureAtlas::from_grid_with_padding`

## Migration Guide

`TextureAtlas::from_grid_with_padding` was merged into `from_grid` which takes two additional parameters for padding and an offset.
```
// 0.8
TextureAtlas::from_grid(texture_handle, Vec2::new(24.0, 24.0), 7, 1);
// 0.9
TextureAtlas::from_grid(texture_handle, Vec2::new(24.0, 24.0), 7, 1, None, None)

// 0.8
TextureAtlas::from_grid_with_padding(texture_handle, Vec2::new(24.0, 24.0), 7, 1, Vec2::new(4.0, 4.0));
// 0.9
TextureAtlas::from_grid(texture_handle, Vec2::new(24.0, 24.0), 7, 1, Some(Vec2::new(4.0, 4.0)), None)
```

Co-authored-by: olefish <88390729+oledfish@users.noreply.github.com>
2022-09-24 12:58:06 +00:00
..
mesh2d Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
render Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
bundle.rs Visibilty Inheritance, universal ComputedVisibility and RenderLayers support (#5310) 2022-07-15 23:24:42 +00:00
collide_aabb.rs Add more documentation and tests to collide_aabb::collide() (#5910) 2022-09-12 01:25:34 +00:00
dynamic_texture_atlas_builder.rs Move sprite::Rect into bevy_math (#5686) 2022-09-02 12:35:23 +00:00
lib.rs Move sprite::Rect into bevy_math (#5686) 2022-09-02 12:35:23 +00:00
sprite.rs Sprite: allow using a sub-region (Rect) of the image (#6014) 2022-09-18 22:49:27 +00:00
texture_atlas.rs Merge TextureAtlas::from_grid_with_padding into TextureAtlas::from_grid through option arguments (#6057) 2022-09-24 12:58:06 +00:00
texture_atlas_builder.rs Move sprite::Rect into bevy_math (#5686) 2022-09-02 12:35:23 +00:00