# SRectTransform

**Membres** 13

|           |                                                                 |                                                                                                                       |
| --------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| Fonction  | [SetParent](#setparent)                                         | Set the parent of the transform.                                                                                      |
| Fonction  | [SetInsetAndSizeFromParentEdge](#setinsetandsizefromparentedge) | Set the distance of this rectangle relative to a specified edge of the parent rectangle, while also setting its size. |
| Fonction  | [SetSizeWithCurrentAnchors](#setsizewithcurrentanchors)         | Makes the RectTransform calculated rect be a given size on the specified axis.                                        |
| Propriété | [Rect](#rect)                                                   | –                                                                                                                     |
| Propriété | [anchorMin](#anchormin)                                         | The normalized position in the parent RectTransform that the lower left corner is anchored to.                        |
| Propriété | [anchorMax](#anchormax)                                         | –                                                                                                                     |
| Propriété | [anchoredPosition3D](#anchoredposition3d)                       | –                                                                                                                     |
| Propriété | [anchoredPosition](#anchoredposition)                           | –                                                                                                                     |
| Propriété | [sizeDelta](#sizedelta)                                         | The size of this RectTransform relative to the distances between the anchors.                                         |
| Propriété | [pivot](#pivot)                                                 | The normalized position in this RectTransform that it rotates around.                                                 |
| Propriété | [offsetMin](#offsetmin)                                         | The offset of the lower left corner of the rectangle relative to the lower left anchor.                               |
| Propriété | [offsetMax](#offsetmax)                                         | The offset of the upper right corner of the rectangle relative to the upper right anchor.                             |
| Propriété | [GameObject](#gameobject)                                       | –                                                                                                                     |

## Fonctions

### SetParent

void SetParent([SGameObject](/docs/fr/scripting/client-scripting-api-reference/types/sgameobject.md) parent, bool worldPositionStays)

Set the parent of the transform.

Paramètres

| Nom                | Type                                                                                  | Valeur par défaut |
| ------------------ | ------------------------------------------------------------------------------------- | ----------------- |
| parent             | [SGameObject](/docs/fr/scripting/client-scripting-api-reference/types/sgameobject.md) | –                 |
| worldPositionStays | bool                                                                                  | –                 |

Valeurs de retour

`void`

Exemple

**Lua**

```lua
Space.Host.ExecutingObject.RectTransform.SetParent(anotherGameObject)

```

### SetInsetAndSizeFromParentEdge

void SetInsetAndSizeFromParentEdge(int edge, float inset, float size)

Set the distance of this rectangle relative to a specified edge of the parent rectangle, while also setting its size.

Paramètres

| Nom   | Type  | Valeur par défaut |
| ----- | ----- | ----------------- |
| edge  | int   | –                 |
| inset | float | –                 |
| size  | float | –                 |

Valeurs de retour

`void`

Exemple

**Lua**

```lua
Space.Host.ExecutingObject.RectTransform.SetInsetAndSizeFromParentEdge(2, 3.0, 10.0)

```

### SetSizeWithCurrentAnchors

void SetSizeWithCurrentAnchors(bool vertical, float size)

Makes the RectTransform calculated rect be a given size on the specified axis.

Paramètres

| Nom      | Type  | Valeur par défaut |
| -------- | ----- | ----------------- |
| vertical | bool  | –                 |
| size     | float | –                 |

Valeurs de retour

`void`

Exemple

**Lua**

```lua
Space.Host.ExecutingObject.RectTransform.SetSizeWithCurrentAnchors(true, 10.0)

```

## Propriétés

### Rect

[SRect](/docs/fr/scripting/client-scripting-api-reference/types/srect.md) Rect {get; }

Exemple

**Lua**

```lua
rect = Space.Host.ExecutingObject.RectTransform.Rect

```

### anchorMin

[SVector](/docs/fr/scripting/client-scripting-api-reference/types/svector.md) anchorMin {get; set; }

The normalized position in the parent RectTransform that the lower left corner is anchored to.

Exemple

**Lua**

```lua
Space.Host.ExecutingObject.RectTransform.anchorMin= Vector.New(0.3,0.3,0)

```

### anchorMax

[SVector](/docs/fr/scripting/client-scripting-api-reference/types/svector.md) anchorMax {get; set; }

Exemple

**Lua**

```lua
Space.Host.ExecutingObject.RectTransform.anchorMax= Vector.New(0.7,0.6,0)

```

### anchoredPosition3D

[SVector](/docs/fr/scripting/client-scripting-api-reference/types/svector.md) anchoredPosition3D {get; set; }

Exemple

**Lua**

```lua
Space.Host.ExecutingObject.RectTransform.anchoredPosition3D= Vector.New(0.7,0.6,0)

```

### anchoredPosition

[SVector](/docs/fr/scripting/client-scripting-api-reference/types/svector.md) anchoredPosition {get; set; }

Exemple

**Lua**

```lua
Space.Host.ExecutingObject.RectTransform.anchoredPosition= Vector.New(0.7,0.6,0)

```

### sizeDelta

[SVector](/docs/fr/scripting/client-scripting-api-reference/types/svector.md) sizeDelta {get; set; }

The size of this RectTransform relative to the distances between the anchors.

Exemple

**Lua**

```lua
Space.Host.ExecutingObject.RectTransform.sizeDelta= Vector.New(90,90,0)

```

### pivot

[SVector](/docs/fr/scripting/client-scripting-api-reference/types/svector.md) pivot {get; set; }

The normalized position in this RectTransform that it rotates around.

Exemple

**Lua**

```lua
Space.Host.ExecutingObject.RectTransform.pivot= Vector.New(0.4,0.4,0)

```

### offsetMin

[SVector](/docs/fr/scripting/client-scripting-api-reference/types/svector.md) offsetMin {get; set; }

The offset of the lower left corner of the rectangle relative to the lower left anchor.

Exemple

**Lua**

```lua
Space.Host.ExecutingObject.RectTransform.offsetMin= Vector.New(-50,-50,0)

```

### offsetMax

[SVector](/docs/fr/scripting/client-scripting-api-reference/types/svector.md) offsetMax {get; set; }

The offset of the upper right corner of the rectangle relative to the upper right anchor.

Exemple

**Lua**

```lua
Space.Host.ExecutingObject.RectTransform.offsetMax= Vector.New(50,50,0)

```

### GameObject

[SGameObject](/docs/fr/scripting/client-scripting-api-reference/types/sgameobject.md) GameObject {get; }

Exemple

**Lua**

```lua
theGameObject = Space.Host.ExecutingObject.RectTransform.GameObject

```
