ClementSparrow / Pattern-Script

Open Source HTML5 Game Engine based on PuzzleScript
20 stars 2 forks source link

Add new transform to truncate a sprite to the default sprite size #39

Open m-ender opened 2 years ago

m-ender commented 2 years ago

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.

ClementSparrow commented 2 years ago

I will need to think a little bit about the use cases and what is the best way to do this.

m-ender commented 2 years ago

A couple of use cases (mostly reproduced from our Discord conversation, but to have them here for reference):