Imagine a random number of square sprites of any size are created in random positions like so
Now I need to find a way to create a sort of perimeter with the arrangement like so
The sprites could be overlapping and in completely random positions. How can I go about doing this? I want to avoid checking for any kind of collisions or overlapping for performance reasons.
A basic perimeter is also fine, doesn't have to touch each corner of the square.