# GenerateAtlas(Vector2[], int, int, List<Rect>)

> Packs a set of rectangles into a square atlas, with optional padding between rectangles.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public static bool GenerateAtlas(Vector2[] sizes, int padding, int atlasSize, List<Rect> results)
```

### Parameters

**** (\[Vector2\[]]\(/engine/6000.7/script-reference/unityengine/vector2)): An array of rectangle dimensions.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Amount of padding to insert between adjacent rectangles in the atlas.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The size of the atlas.**** (\[List\<Rect>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)): If the function succeeds, Unity populates this with the packed rectangles.

### Returns

| Type                                                          | Description                                                          |
| ------------------------------------------------------------- | -------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns `true` if the function succeeds. Otherwise, returns `false`. |

### Remarks

Additional Resources: [Texture2D.PackTextures](/engine/6000.7/script-reference/unityengine/texture2d/packtextures.md).
