You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I rotated a sliced and custom sized sprite around an off-center anchor
What went wrong
I expected the sprite to be correctly scaled and rotated,
but the sliced parts leave gaps and do not seem to behave correctly. See the below screenshot:
The problem is in this line caused by anchor (even without rotation), because at some moment all parts of Sprite extracts as separate extracted sprites, at this moment each of them know self size, anchor in dimensions of global sprite, but not dimensions of global sprite. That's why the smaller sprite part is, the smaller anchor impact would be. Here is result of some workaround (I changed anchor for each part of sprite from global sprite dimensions to self dimensions)
…2769)
# Objective
Fixes#12408 .
Fixes#12680.
## Solution
- Recaclulated anchor from dimensions of sprite to dimension of each
part of it (each part contains its own anchor)
Bevy version
bevy main f0a9864
What you did
I rotated a sliced and custom sized sprite around an off-center anchor
What went wrong
I expected the sprite to be correctly scaled and rotated,
but the sliced parts leave gaps and do not seem to behave correctly. See the below screenshot:
Additional information
I just modified the sprite_slice example, you can inspect the changed example code in my fork
Am I misusing the TextureSlicer here? Should I actually be rotating something else, like a parent entity instead of the sliced sprite entity?
The text was updated successfully, but these errors were encountered: