Studio Yotsuba
Back to Node List

NineSlice Pack

nine_slice_pack

Builds a reusable nine-slice window material from small image parts.

Reviewed
Guide available

Input Ports

NameTypeDescription
Corner
corner
Image
Corner image used by the 3-part mode.
Edge
edge
Image
Edge image used by the 3-part mode.
Center
center
Image
Center fill image used by the 3-part mode.
Parts
parts
List<Image>
Image list for 5-part / 9-part modes.
SpriteSheet
spritesheet
SpriteSheet
SpriteSheet frames for 5-part / 9-part modes.

Output Ports

NameTypeDescription
NineSlice
nine_slice
NineSlice
Reusable nine-slice material.
Image
image
Image
Packed source image containing the nine areas.
Summary
summary
Text
Short result summary.
Warnings
warnings
Text
Warnings produced while building the material.

Parameters

NameTypeDefaultRangeDescription / Options
Name
name
Text
NineSlice—

Material name saved in the NineSlice document.

Mode
mode
Enum
ThreeParts—

How input images are interpreted.

  • 3_partsThreeParts
    Use corner, edge, and center inputs. Missing sides are generated by flipping or rotating.
  • 5_partsFiveParts
    Use five frames/images: corner, top, bottom, side, center.
  • 9_partsNineParts
    Use nine frames/images in reading order: top-left, top, top-right, left, center, right, bottom-left, bottom, bottom-right.
  • list_orderListOrder
    Always read nine images from the Parts list in nine-slice order.
  • spritesheet_orderSpriteSheetOrder
    Always read nine frames from the SpriteSheet in nine-slice order.
Edge Mode
edge_mode
Enum
Repeat—

Default edge scaling mode saved in the material.

  • repeatRepeat
    Tile edge pixels repeatedly. Best for pixel-art borders.
  • stretchStretch
    Stretch edge pixels to the requested length.
Center Mode
center_mode
Enum
Repeat—

Default center scaling mode saved in the material.

  • repeatRepeat
    Tile the center repeatedly.
  • stretchStretch
    Stretch the center to fill the area.
  • transparentTransparent
    Leave the center transparent.
Padding Left
padding_left
Int
00–512

Inner content padding. 0 means use the left border width.

Padding Right
padding_right
Int
00–512

Inner content padding. 0 means use the right border width.

Padding Top
padding_top
Int
00–512

Inner content padding. 0 means use the top border height.

Padding Bottom
padding_bottom
Int
00–512

Inner content padding. 0 means use the bottom border height.

Overview

Builds a resizable window asset (NineSlice) from small corner, edge, and center parts. It provides the foundation for batch-producing RPG message windows, UI panels, and button frames from small pixel-art parts.

Usage tips

  • The simplest starting point is ThreeParts: one corner, one edge, and one center create a symmetrical frame. Move to 5 or 9 parts when you need more elaborate designs.
  • The parts can be images generated inside the graph, enabling workflows that manage color variations for every frame part with one palette.
  • nine_slice_render performs the drawing. This node only defines the asset.

Related nodes

  • nine_slice_render — the rendering counterpart; usually used together

  • list_create — bundles the parts list

  • text_rasterize — creates text for the window; composite it with blend

  • Primary uses: RPG message windows, UI panels, button frames, speech-bubble frames, and similar elements

  • Dedicated output type: NineSlice

NineSlice is dedicated data for a nine-slice asset. In addition to images, it stores information such as left-border width, top-border height, whether the center repeats or stretches, and the inner area available for text.

What is nine-slice?

Nine-slice treats a window image as the following nine regions.

Top left Top Top right
Left Center Right
Bottom left Bottom Bottom right
  • Corners stay unchanged when the source cells already match. When part sizes differ, the packer repeat-fills them to the largest cell in the 3x3 grid and lists the affected parts in warnings.
  • Top, bottom, left, and right edges repeat horizontally or vertically, or stretch.
  • The center can repeat, stretch, or remain transparent.

This lets you create large text windows from small pixel-art assets.

Build methods

Value Display name Required inputs Description
ThreeParts 3 parts corner, edge, center Builds from one corner, one edge, and one center, requiring few assets.
FiveParts 5 parts parts or spritesheet Builds from five images: corner, top edge, bottom edge, side edge, and center. The top and bottom can use different designs.
NineParts 9 parts parts or spritesheet Uses a separate image for every region, providing the most freedom.
ListOrder 9 parts in list order parts Uses the first nine images in parts in nine-slice order.
SpriteSheetOrder 9 parts in sheet order spritesheet Uses the first nine frames in the sprite sheet in nine-slice order.

Five-part order

Arrange parts or spritesheet in this order:

  1. Corner
  2. Top edge
  3. Bottom edge
  4. Side edge
  5. Center

Nine-part order

Arrange parts or spritesheet in this order:

  1. Top left
  2. Top
  3. Top right
  4. Left
  5. Center
  6. Right
  7. Bottom left
  8. Bottom
  9. Bottom right

Scale methods

Value Display name Description
Repeat Repeat Tiles the same part. Best for pixel-art borders.
Stretch Stretch Stretches the part to the requested size. Best for gradients and simple flat areas.
Transparent Transparent Leaves the center undrawn and transparent. Use it for a frame with a see-through center.

Transparent is available only for the center scaling method.

Basic usage

  1. Prepare images for the corner, edge, and center parts.
  2. Place NineSlice Pack.
  3. Set the build method to 3 parts.
  4. Connect images to corner, edge, and center.
  5. Connect the nine_slice output to the nine_slice input of NineSlice Render.

Notes

  • This node creates the asset. Set the final window dimensions in NineSlice Render.
  • 3 parts requires few assets, but use 9 parts when every edge and corner needs a separate design.
  • If both parts and spritesheet are connected, parts takes priority.
  • padding_* is limited to 0–512. Out-of-range promoted values are clamped and produce a parameter_clamped warning. Zero means “use the matching border width.”
  • summary and warnings use stable locale-independent diagnostics. parts_normalized_repeat reports size normalization and parts_truncated reports ignored extra inputs.
Back to Node List