Stretching a sprite without distortion

In UI it’s common to have stretchable images, such that you section it off into nine sections.

CWC
HMH
CWC

The four corners (the C’s!) don’t stretch at all. The W’s are only stretched horizontally, the H’s vertically, and the M in all directions. It allows easily resizable images without distortion, provided you design your image with that in mind. It’s a nice effect!

Anyway, does Unity have anything like that? Not just for UI, but, say, if I wanted a simple wall in my level, but I didn’t want to create a tiling sprite. I want it to have the same style border, no matter how big.

RagePixel (which I was using pre-4.3) has this feature, called GRID9, and it is pretty useful!

1424402--75178--$resize_grid9.PNG

It’s not native, but you could probably whip something up like this yourself pretty easily with the new tools. Just use a sprite for each corner, each side, and the middle and only scale the middle and sides, but not the corner.

Yeah, I’m sure I could do it. Just didn’t want to reinvent the wheel. Oh well, thanks.