# SRectTransform

**الأعضاء** 13

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

## الدوال

### SetParent

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

Set the parent of the transform.

المعاملات

| الاسم              | النوع                                                                                 | القيمة الافتراضية |
| ------------------ | ------------------------------------------------------------------------------------- | ----------------- |
| parent             | [SGameObject](/docs/ar/scripting/client-scripting-api-reference/types/sgameobject.md) | –                 |
| worldPositionStays | bool                                                                                  | –                 |

القيم المرجعة

`void`

مثال

**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.

المعاملات

| الاسم | النوع | القيمة الافتراضية |
| ----- | ----- | ----------------- |
| edge  | int   | –                 |
| inset | float | –                 |
| size  | float | –                 |

القيم المرجعة

`void`

مثال

**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.

المعاملات

| الاسم    | النوع | القيمة الافتراضية |
| -------- | ----- | ----------------- |
| vertical | bool  | –                 |
| size     | float | –                 |

القيم المرجعة

`void`

مثال

**Lua**

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

```

## الخصائص

### Rect

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

مثال

**Lua**

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

```

### anchorMin

[SVector](/docs/ar/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.

مثال

**Lua**

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

```

### anchorMax

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

مثال

**Lua**

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

```

### anchoredPosition3D

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

مثال

**Lua**

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

```

### anchoredPosition

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

مثال

**Lua**

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

```

### sizeDelta

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

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

مثال

**Lua**

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

```

### pivot

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

The normalized position in this RectTransform that it rotates around.

مثال

**Lua**

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

```

### offsetMin

[SVector](/docs/ar/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.

مثال

**Lua**

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

```

### offsetMax

[SVector](/docs/ar/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.

مثال

**Lua**

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

```

### GameObject

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

مثال

**Lua**

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

```
