wiki.sine.space | sinespace

Difference between revisions of "Scripting/SUILayout"

From wiki.sine.space
Jump to: navigation, search
Line 2: Line 2:
  
  
{{ScriptFunction|bool|Enabled|{ get;set; }|Enabled Behaviours are Updated, disabled Behaviours are not.|5= <pre></pre>}}
+
{{ScriptFunction|bool|Enabled|{ get;set; }|Enabled Behaviours are Updated, disabled Behaviours are not.|5= <pre>Space.Host.ExecutingObject.UILayout.Enabled = false</pre>}}
  
{{ScriptFunction|int|PaddingLeft|{ get;set; }|Space reserved for the left edge of the padding during the layout phase.|5= <pre></pre>}}
+
{{ScriptFunction|int|PaddingLeft|{ get;set; }|Space reserved for the left edge of the padding during the layout phase.|5= <pre>Space.Host.ExecutingObject.UILayout.PaddingLeft= 2</pre>}}
  
{{ScriptFunction|int|PaddingRight|{ get;set; }|Space reserved for the right edge of the padding during the layout phase.|5= <pre></pre>}}
+
{{ScriptFunction|int|PaddingRight|{ get;set; }|Space reserved for the right edge of the padding during the layout phase.|5= <pre>Space.Host.ExecutingObject.UILayout.PaddingRight= 2</pre>}}
  
{{ScriptFunction|int|PaddingTop|{ get;set; }|Space reserved for the topedge of the padding during the layout phase.|5= <pre></pre>}}
+
{{ScriptFunction|int|PaddingTop|{ get;set; }|Space reserved for the top edge of the padding during the layout phase.|5= <pre>Space.Host.ExecutingObject.UILayout.PaddingTop= 2</pre>}}
  
{{ScriptFunction|int|PaddingBottom|{ get;set; }|Space reserved for the bottom edge of the padding during the layout phase.|5= <pre></pre>}}
+
{{ScriptFunction|int|PaddingBottom|{ get;set; }|Space reserved for the bottom edge of the padding during the layout phase.|5= <pre>Space.Host.ExecutingObject.UILayout.PaddingBottom= 2</pre>}}
  
 
{{ScriptFunction|string|ChildAlignment|{ get;set; }|The alignment to use for the child layout elements in the layout group.
 
{{ScriptFunction|string|ChildAlignment|{ get;set; }|The alignment to use for the child layout elements in the layout group.
  
If some child layout elements specify no flexible width and height, the children may not take up all the available space inside the layout group. The alignment setting specifies how to align them within the layout group when this is the case.|5= <pre></pre>}}
+
If some child layout elements specify no flexible width and height, the children may not take up all the available space inside the layout group. The alignment setting specifies how to align them within the layout group when this is the case. "0" = Upper Left, "1" = Upper Center, "2" = Upper Right, "3" = Middle Left, "4" = Middle Center, "5" = Middle Right, "6" = Lower Left, "7" = Lower Center, "8" = Lower Right|5= <pre>Space.Host.ExecutingObject.UILayout.ChildAlignment = "1"</pre>}}
  
{{ScriptFunction|float|Spacing|{ get;set; }|The spacing to use between layout elements in the layout group.|5= <pre></pre>}}
+
{{ScriptFunction|float|Spacing|{ get;set; }|The spacing to use between layout elements in the layout group.|5= <pre>Space.Host.ExecutingObject.UILayout.Spacing= 2</pre>}}
  
 
{{ScriptFunction|bool|ChildControlHeight|{ get;set; }|Returns true if the Layout Group controls the heights of its children. Returns false if children control their own heights.
 
{{ScriptFunction|bool|ChildControlHeight|{ get;set; }|Returns true if the Layout Group controls the heights of its children. Returns false if children control their own heights.
Line 22: Line 22:
 
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 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.|5= <pre></pre>}}
+
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.|5= <pre>Space.Host.ExecutingObject.UILayout.ChildControlHeight= true</pre>}}
  
 
{{ScriptFunction|bool|ChildControlWidth|{ get;set; }|Returns true if the Layout Group controls the widths of its children. Returns false if children control their own widths.
 
{{ScriptFunction|bool|ChildControlWidth|{ get;set; }|Returns true if the Layout Group controls the widths of its children. Returns false if children control their own widths.
Line 28: Line 28:
 
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 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.|5= <pre></pre>}}
+
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.|5= <pre>Space.Host.ExecutingObject.UILayout.ChildControlWidth= false</pre>}}
  
{{ScriptFunction|bool|ChildForceExpandHeight|{ get;set; }|Whether to force the children to expand to fill additional available vertical space.|5= <pre></pre>}}
+
{{ScriptFunction|bool|ChildForceExpandHeight|{ get;set; }|Whether to force the children to expand to fill additional available vertical space.|5= <pre>Space.Host.ExecutingObject.UILayout.ChildForceExpandHeight= false</pre>}}
  
{{ScriptFunction|bool|ChildForceExpandWidth|{ get;set; }|Whether to force the children to expand to fill additional available horizontal space.|5= <pre></pre>}}
+
{{ScriptFunction|bool|ChildForceExpandWidth|{ get;set; }|Whether to force the children to expand to fill additional available horizontal space.|5= <pre>Space.Host.ExecutingObject.UILayout.ChildForceExpandWidth= false</pre>}}
  
{{ScriptFunction|Svector|GridCellSize|{ get;set; }|The size to use for each cell in the grid.|5= <pre></pre>}}
+
{{ScriptFunction|Svector|GridCellSize|{ get;set; }|The size to use for each cell in the grid.|5= <pre>Space.Host.ExecutingObject.UILayout.GridCellSize= Vector.New(1,1,0)</pre>}}
  
{{ScriptFunction|Svector|GridSpacing|{ get;set; }|The spacing to use between layout elements in the grid.|5= <pre></pre>}}
+
{{ScriptFunction|Svector|GridSpacing|{ get;set; }|The spacing to use between layout elements in the grid.|5= <pre>Space.Host.ExecutingObject.UILayout.GridSpacing= Vector.New(1,1,0)</pre>}}
  
{{ScriptFunction|int|GridConstraintCount|{ get;set; }|How many cells there should be along the constrained axis.|5= <pre></pre>}}
+
{{ScriptFunction|int|GridConstraintCount|{ get;set; }|How many cells there should be along the constrained axis.|5= <pre>Space.Host.ExecutingObject.UILayout.GridConstraintCount= 2</pre>}}
  
 
{{ScriptFunction|string|GridConstraint|{ get;set; }|Which constraint to use for the GridLayoutGroup.
 
{{ScriptFunction|string|GridConstraint|{ get;set; }|Which constraint to use for the GridLayoutGroup.
  
Specifying a constraint can make the GridLayoutGroup work better in conjunction with a ContentSizeFitter component. When GridLayoutGroup is used on a RectTransform with a manually specified size, there's no need to specify a constraint.|5= <pre></pre>}}
+
Specifying a constraint can make the GridLayoutGroup work better in conjunction with a ContentSizeFitter component. When GridLayoutGroup is used on a RectTransform with a manually specified size, there's no need to specify a constraint. "0" = Flexible, "1" = Fixed Column Count, "2" = Fixed Row Count
 +
|5= <pre>Space.Host.ExecutingObject.UILayout.GridConstraint = 1</pre>}}
  
  

Revision as of 11:05, 24 September 2021

Properties

Enabled

bool Enabled { get;set; }

Enabled Behaviours are Updated, disabled Behaviours are not.

Space.Host.ExecutingObject.UILayout.Enabled = false


PaddingLeft

int PaddingLeft { get;set; }

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

Space.Host.ExecutingObject.UILayout.PaddingLeft= 2


PaddingRight

int PaddingRight { get;set; }

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

Space.Host.ExecutingObject.UILayout.PaddingRight= 2


PaddingTop

int PaddingTop { get;set; }

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

Space.Host.ExecutingObject.UILayout.PaddingTop= 2


PaddingBottom

int PaddingBottom { get;set; }

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

Space.Host.ExecutingObject.UILayout.PaddingBottom= 2


ChildAlignment

string ChildAlignment { get;set; }

No documentation

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


Spacing

float Spacing { get;set; }

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

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.

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.

Space.Host.ExecutingObject.UILayout.ChildControlWidth= false


ChildForceExpandHeight

bool ChildForceExpandHeight { get;set; }

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

Space.Host.ExecutingObject.UILayout.ChildForceExpandHeight= false


ChildForceExpandWidth

bool ChildForceExpandWidth { get;set; }

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

Space.Host.ExecutingObject.UILayout.ChildForceExpandWidth= false


GridCellSize

Svector GridCellSize { get;set; }

The size to use for each cell in the grid.

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


GridSpacing

Svector GridSpacing { get;set; }

The spacing to use between layout elements in the grid.

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.

Space.Host.ExecutingObject.UILayout.GridConstraintCount= 2


GridConstraint

string GridConstraint { get;set; }

No documentation

Space.Host.ExecutingObject.UILayout.GridConstraint = 1