#Picking a sprite from spritesheet according to entity's rotation instead of rotating a sprite?

9 messages · Page 1 of 1 (latest)

somber hatch
#

I want o do graphics in factorio style, a look from the side at a 45 degree angle. For that I need to render a spritesheet with all rotations of an object. Can I do so that transform rotation doesn't rotate the sprite but chooses an according sprite from spritesheet?

cinder river
#

why not add your own component with a system which handles this case and updates the spritesheet index?

somber hatch
#

I also need to use rotation for rotating collision box (bevy_rapier2d's Collider) of the entity

cinder river
#

you could react to the same component change and rotate the collider (or a child transform)

somber hatch
#

I guess I can figure that out with parenting. For now I'll stick to top-down view with prototype sprites that don't need any workarounds

#

What would really be the solution is to somehow disable the rotation affecting sprite at all

#

And then a system that selects the correct sprite for current rotation

hallow yacht
#

you can write your own Sprite extraction function that ignores rotation

#

create a new sprite component UnrotatedSprite or something and remove any rotation from the transform before you add the extracted sprite to the extracted sprites queue