Could be called truncate, trim or clip. I'm thinking it might also be nice to have an optional directional parameter, which would only truncate the sprite in that direction. Offsets for custom cutoff points don't need to be specified because they could be realised by translating, truncating, translating instead.
I'm not 100% sure how this should interact with translated sprites, but it would probably keep the offset unchanged but take it into account when deciding where to cut off the sprite.
A couple of use cases (mostly reproduced from our Discord conversation, but to have them here for reference):
Implementing a marquee/number lock/one-armed bandit style effect, where characters move through a cell but should be cut off at the edges they appear/disappear through.
Jigsaw-style games where you need to assemble a large image from cell-sized pieces. You could define the target image as a single large sprite and then generate the pieces by translating and truncating the large sprite.
Could be called
truncate
,trim
orclip
. I'm thinking it might also be nice to have an optional directional parameter, which would only truncate the sprite in that direction. Offsets for custom cutoff points don't need to be specified because they could be realised by translating, truncating, translating instead.I'm not 100% sure how this should interact with translated sprites, but it would probably keep the offset unchanged but take it into account when deciding where to cut off the sprite.