Conversation
…tched variant Reduced the computed slices iteration count
|
@mockersf does this adress your concerns ? @alice-i-cecile what do you think of this "extra component" concept ? |
|
It looks like your PR is a breaking change, but you didn't provide a migration guide. Could you add some context on what users should update when this change get released in a new version of Bevy? |
alice-i-cecile
left a comment
There was a problem hiding this comment.
I like the additional component: this feels very much like how the ECS architecture is supposed to work. I think you did an excellent job documenting the fact that this exists as well.
pablo-lua
left a comment
There was a problem hiding this comment.
I think that's a fair change on this field and can rather improve perf when we don't need this feature, so all good
IMO no, the docs about this feature is good enough, the user can pretty much find this on they own, and we even have examples showing how to use this |
@mockersf expressed some valid concerns about the current system this PR attempts to fix:
The
ComputedTextureSlicesreacts to asset change in bothbevy_spriteandbevy_ui, meaning that if theImageScaleModeis inserted by default in the bundles, we will iterate through most 2d items every time an asset is updated.Solution
ImageScaleModeonly has two variants:SlicedandTiled. I removed theStretcheddefaultImageScaleModeis no longer part of any bundle, but the relevant bundles explain that this additional component can be insertedThis way, the absence of
ImageScaleModemeans the image will be stretched, and its presence will include the entity to the various slicing systemsOptional components in bundles would make this more straigthfoward
Additional work
Should I add new bundles with the
ImageScaleModecomponent ?