Author Topic: I made a 9-Slice Node  (Read 837 times)

I wanted to share a node I've been working on that allows you to create a 9-Slice.

What is 9-Slice?

A 9-Slice, is a set of 9 images that allows you to create a resizable box that will preserve the corners.  These can often be found in User Interface designs, you can freely scale the width and height while keeping the corners square.

Some things you can do with it:
  • Create pill or capsule shapes that won't stretch rounded corners.
  • Create different sized Octogons with 45 degree angles
  • Create ornate corners, such as stylized furniture embellishments

How it works:

You can can input up to 9 images:

Code: [Select]
(Upper Left)   (Top)        (Upper Right)

(Right)        (Center)     (Left)

(Bottom Left)  (Bottom)     (Bottom Right)

You can then uniformly scale the corners, and independently scale the width and height of the shape.

There are two preset shapes, curved corners and straight corners, and a custom input (all 9 images).

You can switch between Nearest Neighbor and Bilinear (Due to the way FX maps scale shapes up and down, Bilinear can show seams in some cases, I recommend Nearest Neighbor). 

Out of the box, I find this incredibly useful just for making pill shapes (which is why I made it) or any rounded corner box. 

This is really nice!
It is the kind of tool that can be used to make really great greebles.
Awesome work.
"Better than some, no worse than others."