Cropping costumes

I'm trying to create a system to write and read from spritesheets in Snap!, and I was wondering if it was possible to crop costumes? Something like this:
untitled script pic (9)

I've got one that adds borders - I'll modify it to crop

image

x parameters are pixels from left/right edge (1 and -1 mean no cropping)
y parameters are top/bottom

You can use positive distance from left/top edges instead of negative if you wish.

If you need any other options- give me a yell

ProjectName=cropCostume

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Minor update
Added some range checking to the right/bottom values so that you can't exceed the size of the costume being cropped

(Came up while trying to crop an image from my Mayflower project)

image

image
[edit 6Oct21
More bounds checking added - left/top can't be less than 1 and if left>right or top>bottom it returns nothing