# SRectTransform

## Index

### Functions Index

| Function Name                                                                                                |
| ------------------------------------------------------------------------------------------------------------ |
| void [**SetParent** ](#setparent)(SGameObject parent, bool worldPositionStays)                               |
| void [**SetInsetAndSizeFromParentEdge** ](#setinsetandsizefromparentedge)(int edge, float inset, float size) |
| void [**SetSizeWithCurrentAnchors** ](#setsizewithcurrentanchors)(bool vertical, float size)                 |

### Properties Index

| Property Name                                                     |
| ----------------------------------------------------------------- |
| SRect [**Rect** ](#rect)`get`                                     |
| SVector [**anchorMin** ](#anchormin)`get` `set`                   |
| SVector [**anchorMax** ](#anchormax)`get` `set`                   |
| SVector [**anchoredPosition3D** ](#anchoredposition3d)`get` `set` |
| SVector [**anchoredPosition** ](#anchoredposition)`get` `set`     |
| SVector [**sizeDelta** ](#sizedelta)`get` `set`                   |
| SVector [**pivot** ](#pivot)`get` `set`                           |
| SVector [**offsetMin** ](#offsetmin)`get` `set`                   |
| SVector [**offsetMax** ](#offsetmax)`get` `set`                   |
| SGameObject [**GameObject** ](#gameobject)`get`                   |

## Functions

### SetParent

void **SetParent** ([SGameObject](https://docs.sine.space/scripting/client-scripting-api-reference/types/sgameobject) parent, bool worldPositionStays)

*Set the parent of the transform.*

| Parameter | Type | Description |
| --------- | ---- | ----------- |
|           |      |             |

{% tabs %}
{% tab title="Lua" %}

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

{% endtab %}
{% endtabs %}

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

| Parameter | Type | Description |
| --------- | ---- | ----------- |
|           |      |             |

{% tabs %}
{% tab title="Lua" %}

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

{% endtab %}
{% endtabs %}

### SetSizeWithCurrentAnchors

void **SetSizeWithCurrentAnchors** (bool vertical, float size)

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

| Parameter | Type | Description |
| --------- | ---- | ----------- |
|           |      |             |

{% tabs %}
{% tab title="Lua" %}

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

{% endtab %}
{% endtabs %}

## Properties

### Rect

[SRect](https://docs.sine.space/scripting/client-scripting-api-reference/types/srect) **Rect** `get`

*Property Description*

{% tabs %}
{% tab title="Lua" %}

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

{% endtab %}
{% endtabs %}

### anchorMin

[SVector](https://docs.sine.space/scripting/client-scripting-api-reference/types/svector) **anchorMin** `get` `set`

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

{% tabs %}
{% tab title="Lua" %}

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

{% endtab %}
{% endtabs %}

### anchorMax

[SVector](https://docs.sine.space/scripting/client-scripting-api-reference/types/svector) **anchorMax** `get` `set`

*Property Description*

{% tabs %}
{% tab title="Lua" %}

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

{% endtab %}
{% endtabs %}

### anchoredPosition3D

[SVector](https://docs.sine.space/scripting/client-scripting-api-reference/types/svector) **anchoredPosition3D** `get` `set`

*Property Description*

{% tabs %}
{% tab title="Lua" %}

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

{% endtab %}
{% endtabs %}

### anchoredPosition

[SVector](https://docs.sine.space/scripting/client-scripting-api-reference/types/svector) **anchoredPosition** `get` `set`

*Property Description*

{% tabs %}
{% tab title="Lua" %}

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

{% endtab %}
{% endtabs %}

### sizeDelta

[SVector](https://docs.sine.space/scripting/client-scripting-api-reference/types/svector) **sizeDelta** `get` `set`

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

{% tabs %}
{% tab title="Lua" %}

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

{% endtab %}
{% endtabs %}

### pivot

[SVector](https://docs.sine.space/scripting/client-scripting-api-reference/types/svector) **pivot** `get` `set`

*The normalized position in this RectTransform that it rotates around.*

{% tabs %}
{% tab title="Lua" %}

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

{% endtab %}
{% endtabs %}

### offsetMin

[SVector](https://docs.sine.space/scripting/client-scripting-api-reference/types/svector) **offsetMin** `get` `set`

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

{% tabs %}
{% tab title="Lua" %}

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

{% endtab %}
{% endtabs %}

### offsetMax

[SVector](https://docs.sine.space/scripting/client-scripting-api-reference/types/svector) **offsetMax** `get` `set`

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

{% tabs %}
{% tab title="Lua" %}

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

{% endtab %}
{% endtabs %}

### GameObject

[SGameObject](https://docs.sine.space/scripting/client-scripting-api-reference/types/sgameobject) **GameObject** `get`

*Property Description*

{% tabs %}
{% tab title="Lua" %}

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

{% endtab %}
{% endtabs %}
