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
Left Top Corner
Top Center
Right Top
Corner
Left Center
Center
Right Center
Bottom Left Corner
Bottom Right Corner
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.
创建不会拉伸圆角的药丸或胶囊形状。
创建具有 45 度角的不同大小的八角形
创建华丽的角落,例如风格化的家具装饰
9个 Slice节点允许您输入多达9张图像:
左上角
顶尖中心
右上角
左中
中央
右中心
左下角
右下角
然后,您可以统一缩放角,并独立缩放形状的宽度和高度。
有两种预设形状,弯角和直角,以及自定义输入(所有 9 张图像)。
您可以在最近邻和双线性之间切换(由于 FX 映射向上和向下缩放形状的方式,双线性在某些情况下可以显示接缝,我推荐最近邻)。