how do i mask a sprite against a canvas?

basically, i’m working on a game to teach hand washing to kids where i have two hand shaped sprites with random bits of dirt that get generated on them that then need to be scrubbed off.

my problem is that sometimes the bits of dirt generate and peek out a little outside the bounds of the hands, and it looks sloppy. i want to somehow use masking (although this might not be the right approach) so that any of the bits of dirt that peek out over the boundary of the hand sprites get masked by the canvas, or otherwise don’t appear.

any suggestions?

Adding a mask component to the hand sprites and making the dirt bits child of the hands could be one way to do it.