bevy icon indicating copy to clipboard operation
bevy copied to clipboard

More idiomatic texture atlas builder

Open s-puig opened this issue 9 months ago • 0 comments

Objective

  • TextureAtlasBuilder has some non-idiomatic methods.

Solution

  • Refactor non-idiomatic methods

Changelog

  • Renamed TextureAtlasBuilder.finish() to build()
  • TextureAtlasBuilder.with_texture() now consumes self and returns Self

Migration Guide

- texture_atlas_builder.add_texture(Some(id), texture);
+ texture_atlas_builder = texture_atlas_builder.add_texture(Some(id), texture);

- let (texture_atlas_layout, texture) = texture_atlas_builder.finish().unwrap();
+ let (texture_atlas_layout, texture) = texture_atlas_builder.build().unwrap();

s-puig avatar May 04 '24 21:05 s-puig