---
title: "9-patch scaling: What’s the difference between borders, rectangle, and padding?"
description: "9-slice scaling defines fixed borders and resizable areas, with some frameworks using border widths and others using an inner rectangle."
canonical: "https://www.codeandweb.com/texturepacker/knowledgebase/nine-scale-borders"
product: "texturepacker"
source: "html"
---

# 9-patch scaling: What’s the difference between borders, rectangle, and padding?

The [9-patch editor](https://www.codeandweb.com/texturepacker/documentation/user-interface-overview.md#9-patch-editor) lets you specify which area of a sprite image should be scaled and which border should remain fixed when the overall image is scaled.

Have a look at the following sprite of size 100x100:

![9-patch sprite example](https://www.codeandweb.com/static/1f3484ecfd42d2cd6409e81cc18a7c15/c0f72/nine-patch-scale-example%402x.png)

*   Some frameworks (like Unity) expect the width of the **fixed borders** (in our example: 20,20,20,20)
*   Others (like Phaser) expect the position and size of the **inner, resizable rectangle** (e.g. 20,20 60x60)

Some frameworks also support **paddings** (or a fill area) to position extra content within a scaled sprite (e.g, a button text). While TexturePacker doesn’t allow configuring paddings, it can read them from Android ".9.png" files and pass them to the exporter.

## Structured data

```json
{
  "@context": "https://schema.org",
  "@type": "TechArticle",
  "headline": "9-patch scaling: What’s the difference between borders, rectangle, and padding?"
}
```
