Cobo Makes Games blog

Game development glossary

Nine-slice scaling

Nine-slice scaling cuts an image into a three-by-three grid: corners never stretch, edges stretch one way and the middle fills, so one frame fits any size.

Also called 9-slice, nine patch, 9-patch.

Nine-slice, also called 9-slice or nine-patch, is the classic way to make one painted frame fit panels of any size. You cut the image along two lines each way. The four corners are drawn at their own size, the four edges stretch in one direction only, and the middle fills whatever space is left, so a carved border stays crisp whether the panel is small or wide.

When should you use it?

Use it for frames whose size changes: dialog boxes, tooltips, inventory pages that rearrange at bigger text sizes. A single fixed painting can look richer, but it can't grow, so it only suits screens whose content rarely changes. Godot has nine-slice built in (NinePatchRect and texture style boxes), and on the web it's one CSS property, border-image.

Nine-slice in Mytheria

The inventory's book is one painted image cut into slices, so its binding and corners keep their size on a wide screen and on a narrow one, while the text, slots and buttons on top stay real, live interface. The pause menu went the other way: one painted wooden plate, 430 by 645 pixels on the 1280 by 800 canvas, which grows with the Interface size setting as far as the window allows and switches to a plain panel when the window is too small.

Opening Mytheria's pause menu over the meadow and stepping through its wooden buttons The full post, with clips and demos Pause menu design: six ways to build one, compared

Mytheria

Coming to Steam

The store page isn't up yet. Leave your email and we'll tell you when you can wishlist Mytheria on Steam.

We'll send that one email and never share your address.

Windows · macOS · Steam Deck