Understanding 9 Slice Objects in Game | hyperPad Blog
Logo

Understanding 9 Slice Objects in Game

June 13, 2025
Understanding 9 Slice Objects in Game

9 Slice Objects (sometimes called 9 Patch) are Objects with margins you set yourself. The margins divide an image into 9 sections and change the way the Object scales.

9 Slice Objects are often used for user interfaces, or for any part of a project that needs to keep its look when it scales.

When you resize a 9 Slice Object, three things usually happen:

  • The corners get moved.
  • The side areas get stretched.
  • The middle section gets scaled.

Start with the Graphic below and try scaling it. You’ll see the difference between a 9 Slice Object and a regular Graphic right away.

The original Graphic before scaling

Here’s a regular Graphic (no 9 Slice margins) scaled horizontally to 230%. Notice how the corners stretch and no longer look square.

The regular Graphic scaled to 230% with stretched corners

Now convert the original Graphic to a 9 Slice Object with 20% margins (the red lines).

The Graphic converted to a 9 Slice Object with red margin lines at 20%

Scale the 9 Slice Object to the same 230% horizontally, and the corners keep their shape.

The 9 Slice Object scaled to 230% with its corners intact

Creating 9 Slice Objects

You can turn any Graphic into a 9 Slice Object. Open the Asset Library, then go to the Graphic you want to convert.

Finding a Graphic in the Asset Library

When you find your Graphic, touch and hold it until the Asset Menu appears. From the Asset Menu, select "Convert to 9-Slice".

The Asset Menu with the Convert to 9-Slice option

Converting to 9 Slice creates all the margins at 40% for you.

A newly converted 9 Slice Object with default margins

Modifying Default Margins

To change the default margins, select "Preview" from the Asset Menu.

The Preview option in the Asset Menu

The "9-Slice Preview" shows the margin lines on your Graphic. It also has input fields with each margin’s position, as a percentage of your Graphic.

The 9-Slice Preview with margin lines and input fields

To change a margin, touch and drag the white circle on its line, or type the number in manually. When you drag a margin line, its input field updates to the new percentage.

Dragging a margin line in the 9-Slice Preview

Modifying Object Specific Margins

You can also change the margins of each 9 Slice Object you add to your Scene without affecting the original 9 Slice Object.

Tap the 9 Slice Object on your canvas. In Object Properties, switch to the General Properties tab (the first tab).

In the General Properties tab, you can see the 4 margins and change their positions manually.

The four margin fields in the General Properties tab

Build a small version in hyperPad

Turn the article’s idea into one testable mechanic before expanding the Project. Put the necessary Objects in a Scene, then open the Behavior Editor. The Behavior Interface Overview explains how an event starts a chain and how connected actions run.

A basic interaction can use this sequence:

  1. Add Started Touching to a button or playable Object.
  2. Connect it to an action such as Apply Force, Set Attribute, or Play Sound.
  3. Press Play and check the result.
  4. Change one value, then test again.
  5. Add a reset or end state before adding another mechanic.

Keep a short test note: what you changed, what you expected, and what actually happened. That habit makes debugging easier because it separates a logic problem from a value that simply needs adjustment.

For a complete beginner workflow, continue with the iPad game development guide. It covers scope, Scenes, Behaviors, assets, playtesting, Hub feedback, and the later App Store workflow.

9 Slice Objects keep scalable Graphics looking right in your games and apps. In hyperPad, converting and adjusting them takes a few taps, so your buttons, panels, and other interface elements stay clean at any size. Try converting one of your own Graphics and see the difference.

hyperPad Starter

Make Your First Game on iPad

Start with one free project in hyperPad Starter. Drag, drop, and connect Behaviors to build your game without traditional code.

Try hyperPad Starter

Free to download · One project included