# SUILayout

**الأعضاء** 16

|       |                                                   |                                                                                        |
| ----- | ------------------------------------------------- | -------------------------------------------------------------------------------------- |
| خاصية | [Enabled](#enabled)                               | Is this UI layout component Enabled?                                                   |
| خاصية | [PaddingLeft](#paddingleft)                       | Space reserved for the left edge of the padding during the layout phase.               |
| خاصية | [PaddingRight](#paddingright)                     | Space reserved for the right edge of the padding during the layout phase.              |
| خاصية | [PaddingTop](#paddingtop)                         | Space reserved for the top edge of the padding during the layout phase.                |
| خاصية | [PaddingBottom](#paddingbottom)                   | Space reserved for the bottom edge of the padding during the layout phase.             |
| خاصية | [ChildAlignment](#childalignment)                 | –                                                                                      |
| خاصية | [Spacing](#spacing)                               | The spacing to use between layout elements in the layout group.                        |
| خاصية | [ChildControlHeight](#childcontrolheight)         | Returns true if the Layout Group controls the heights of its children.                 |
| خاصية | [ChildControlWidth](#childcontrolwidth)           | Returns true if the Layout Group controls the widths of its children.                  |
| خاصية | [ChildForceExpandHeight](#childforceexpandheight) | Whether to force the children to expand to fill additional available vertical space.   |
| خاصية | [ChildForceExpandWidth](#childforceexpandwidth)   | Whether to force the children to expand to fill additional available horizontal space. |
| خاصية | [GridCellSize](#gridcellsize)                     | The size to use for each cell in the grid.                                             |
| خاصية | [GridSpacing](#gridspacing)                       | The spacing to use between layout elements in the grid.                                |
| خاصية | [GridConstraintCount](#gridconstraintcount)       | How many cells there should be along the constrained axis.                             |
| خاصية | [GridConstraint](#gridconstraint)                 | –                                                                                      |
| خاصية | [GameObject](#gameobject)                         | –                                                                                      |

## الخصائص

### Enabled

bool Enabled {get; set; }

Is this UI layout component Enabled?

مثال

**Lua**

```lua
Space.Host.ExecutingObject.UILayout.Enabled = false

```

**Lua**

```lua
--clicking this object will toggle a Layout's Enabled status

thisGameObject = Space.Host.ExecutingObject
layout = Space.Host.GetReference("layout").UILayout 
--make sure to add this reference to the Scripting Runtime component


OnClick = function()
layout.Enabled=  not layout.Enabled
end


thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)

```

### PaddingLeft

int PaddingLeft {get; set; }

Space reserved for the left edge of the padding during the layout phase.

مثال

**Lua**

```lua
Space.Host.ExecutingObject.UILayout.PaddingLeft= 2

```

### PaddingRight

int PaddingRight {get; set; }

Space reserved for the right edge of the padding during the layout phase.

مثال

**Lua**

```lua
Space.Host.ExecutingObject.UILayout.PaddingRight= 2

```

### PaddingTop

int PaddingTop {get; set; }

Space reserved for the top edge of the padding during the layout phase.

مثال

**Lua**

```lua
Space.Host.ExecutingObject.UILayout.PaddingTop= 2

```

### PaddingBottom

int PaddingBottom {get; set; }

Space reserved for the bottom edge of the padding during the layout phase.

مثال

**Lua**

```lua
Space.Host.ExecutingObject.UILayout.PaddingBottom= 2

```

### ChildAlignment

string ChildAlignment {get; set; }

مثال

**Lua**

```lua
Space.Host.ExecutingObject.UILayout.ChildAlignment = "1"

```

### Spacing

float Spacing {get; set; }

The spacing to use between layout elements in the layout group.

مثال

**Lua**

```lua
Space.Host.ExecutingObject.UILayout.Spacing= 2

```

### ChildControlHeight

bool ChildControlHeight {get; set; }

Returns true if the Layout Group controls the heights of its children. Returns false if children control their own heights.

If set to false, the layout group will only affect the positions of the children while leaving the heights untouched. The heights of the children can be set via the respective RectTransforms in this case.

If set to true, the heights of the children are automatically driven by the layout group according to their respective minimum, preferred, and flexible heights. This is useful if the heights of the children should change depending on how much space is available. In this case the height of each child cannot be set manually in the RectTransform, but the minimum, preferred and flexible height for each child can be controlled by adding a LayoutElement component to it.

مثال

**Lua**

```lua
Space.Host.ExecutingObject.UILayout.ChildControlHeight= true

```

### ChildControlWidth

bool ChildControlWidth {get; set; }

Returns true if the Layout Group controls the widths of its children. Returns false if children control their own widths.

If set to false, the layout group will only affect the positions of the children while leaving the widths untouched. The widths of the children can be set via the respective RectTransforms in this case.

If set to true, the widths of the children are automatically driven by the layout group according to their respective minimum, preferred, and flexible widths. This is useful if the widths of the children should change depending on how much space is available. In this case the width of each child cannot be set manually in the RectTransform, but the minimum, preferred and flexible width for each child can be controlled by adding a LayoutElement component to it.

مثال

**Lua**

```lua
Space.Host.ExecutingObject.UILayout.ChildControlWidth= false

```

### ChildForceExpandHeight

bool ChildForceExpandHeight {get; set; }

Whether to force the children to expand to fill additional available vertical space.

مثال

**Lua**

```lua
Space.Host.ExecutingObject.UILayout.ChildForceExpandHeight= false

```

### ChildForceExpandWidth

bool ChildForceExpandWidth {get; set; }

Whether to force the children to expand to fill additional available horizontal space.

مثال

**Lua**

```lua
Space.Host.ExecutingObject.UILayout.ChildForceExpandWidth= false

```

### GridCellSize

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

The size to use for each cell in the grid.

مثال

**Lua**

```lua
Space.Host.ExecutingObject.UILayout.GridCellSize= Vector.New(1,1,0)

```

### GridSpacing

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

The spacing to use between layout elements in the grid.

مثال

**Lua**

```lua
Space.Host.ExecutingObject.UILayout.GridSpacing= Vector.New(1,1,0)

```

### GridConstraintCount

int GridConstraintCount {get; set; }

How many cells there should be along the constrained axis.

مثال

**Lua**

```lua
Space.Host.ExecutingObject.UILayout.GridConstraintCount= 2

```

### GridConstraint

string GridConstraint {get; set; }

مثال

**Lua**

```lua
Space.Host.ExecutingObject.UILayout.GridConstraint = 1

```

### GameObject

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

مثال

**Lua**

```lua
theGameObject = Space.Host.ExecutingObject.UILayout.GridConstraint

```
