How to offset sprites from a sprite sheet?

Hey everyone,

Is it possible to offset sprites? If not any ideas how I would go about it?

See an doom sprite sheet example below: the blue and green sprites are the original sizes of the sprites. To get them to look right their padding needs to be increased to make sure they are centered.

So far I’ve been padding my sprites but it’s making my sprite sheets really large

Any help would be much appreciated!

1 Like

The amazing @Pryme8 added support earlier for sprite maps Sprite Map | Babylon.js Documentation but I do not know if they support such cases ?


Naw they don’t, Honestly our regular sprite stuff should support this but I dont think we accommodate for it as of now. You could with a little bit of effort extend the current system and include the padding data then just add that to the offset on the shader portion of it all.

1 Like

Thanks guys, I might have a crack at extending it. I’ll will update if I have any luck, cheers!

1 Like

This would be awesome @kestrelpi !!!

1 Like