# BackgroundSize

> Script interface for VisualElement background-size style property BackgroundSize.

## Definition

* **Type:** Struct
* **Namespace:** [UnityEngine.UIElements](/engine/6000.6/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule
* **Implements:** [IEquatable\<BackgroundSize>](https://learn.microsoft.com/dotnet/api/system.iequatable-1)

```csharp
public struct BackgroundSize : IEquatable<BackgroundSize>
```

## Constructors

| Constructor                                                                                                                                                                                  | Description                                 |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
| [BackgroundSize(UnityEngine.UIElements.BackgroundSizeType)](/engine/6000.6/script-reference/unityengine/uielements/backgroundsize/ctor.md#backgroundsize\(backgroundsizetype\))              | Create a BackgroundSize using Enum          |
| [BackgroundSize(UnityEngine.UIElements.Length,UnityEngine.UIElements.Length)](/engine/6000.6/script-reference/unityengine/uielements/backgroundsize/ctor.md#backgroundsize\(length-length\)) | Create a BackgroundSize with x and y repeat |

## Properties

| Property                                                                                      | Description          |
| --------------------------------------------------------------------------------------------- | -------------------- |
| [sizeType](/engine/6000.6/script-reference/unityengine/uielements/backgroundsize/sizetype.md) | Background size type |
| [x](/engine/6000.6/script-reference/unityengine/uielements/backgroundsize/x.md)               | Background size x    |
| [y](/engine/6000.6/script-reference/unityengine/uielements/backgroundsize/y.md)               | Background size y    |
