wiki.sine.space | sinespace

Difference between revisions of "Scripting/SRectTransform"

From wiki.sine.space
Jump to: navigation, search
(Added and defined all members (11) of SRectTransform)
 
Line 1: Line 1:
 
==Members==
 
==Members==
 
{{ScriptFunction|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.
 
{{ScriptFunction|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.
|5=<pre></pre>}}
+
|5=<pre>Space.Host.ExecutingObject.RectTransform.SetInsetAndSizeFromParentEdge(2, 3.0, 10.0)</pre>}}
  
{{ScriptFunction|void|SetParent|(SGameObject parent, bool worldPositionStays);|Set the parent of the transform.|5=<pre></pre>}}
+
{{ScriptFunction|void|SetParent|(SGameObject parent, bool worldPositionStays);|Set the parent of the transform.|5=<pre>Space.Host.ExecutingObject.RectTransform.SetParent(anotherGameObject)</pre>}}
  
{{ScriptFunction|void|SetSizeWithCurrentAnchors|(bool vertical, float size);|Makes the RectTransform calculated rect be a given size on the specified axis.|5=<pre></pre>}}
+
{{ScriptFunction|void|SetSizeWithCurrentAnchors|(bool vertical, float size);|Makes the RectTransform calculated rect be a given size on the specified axis.|5=<pre>Space.Host.ExecutingObject.RectTransform.SetSizeWithCurrentAnchors(true, 10.0)</pre>}}
  
  
 
==Properties==
 
==Properties==
{{ScriptFunction|SVector|anchoredPosition|{ get;set; }|The position of the pivot of this RectTransform relative to the anchor reference point.|5=<pre></pre>}}
+
{{ScriptFunction|SVector|anchoredPosition|{ get;set; }|The position of the pivot of this RectTransform relative to the anchor reference point.|5=<pre>Space.Host.ExecutingObject.RectTransform.anchoredPosition = Vector.New(10,50,0)</pre>}}
  
{{ScriptFunction|SVector|anchoredPosition3D|{ get;set; }|The 3D position of the pivot of this RectTransform relative to the anchor reference point.|5=<pre></pre>}}
+
{{ScriptFunction|SVector|anchoredPosition3D|{ get;set; }|The 3D position of the pivot of this RectTransform relative to the anchor reference point.|5=<pre>Space.Host.ExecutingObject.RectTransform.anchoredPosition3D = Vector.New(10,50,10)</pre>}}
  
{{ScriptFunction|SVector|anchorMax|{ get;set; }|The normalized position in the parent RectTransform that the upper right corner is anchored to.|5=<pre></pre>}}
+
{{ScriptFunction|SVector|anchorMax|{ get;set; }|The normalized position in the parent RectTransform that the upper right corner is anchored to.|5=<pre>Space.Host.ExecutingObject.RectTransform.anchorMax= Vector.New(0.8,0.8,0)</pre>}}
  
{{ScriptFunction|SVector|anchorMin|{ get;set; }|The normalized position in the parent RectTransform that the lower left corner is anchored to.|5=<pre></pre>}}
+
{{ScriptFunction|SVector|anchorMin|{ get;set; }|The normalized position in the parent RectTransform that the lower left corner is anchored to.|5=<pre>Space.Host.ExecutingObject.RectTransform.anchorMin= Vector.New(0.3,0.3,0)</pre>}}
  
{{ScriptFunction|SVector|offsetMax|{ get;set; }|The offset of the upper right corner of the rectangle relative to the upper right anchor.|5=<pre></pre>}}
+
{{ScriptFunction|SVector|offsetMax|{ get;set; }|The offset of the upper right corner of the rectangle relative to the upper right anchor.|5=<pre>Space.Host.ExecutingObject.RectTransform.offsetMax= Vector.New(50,50,0)</pre>}}
  
{{ScriptFunction|SVector|offsetMin|{ get;set; }|The offset of the lower left corner of the rectangle relative to the lower left anchor.|5=<pre></pre>}}
+
{{ScriptFunction|SVector|offsetMin|{ get;set; }|The offset of the lower left corner of the rectangle relative to the lower left anchor.|5=<pre>Space.Host.ExecutingObject.RectTransform.offsetMin= Vector.New(-50,-50,0)</pre>}}
  
{{ScriptFunction|SVector|pivot|{ get;set; }|The normalized position in this RectTransform that it rotates around.|5=<pre></pre>}}
+
{{ScriptFunction|SVector|pivot|{ get;set; }|The normalized position in this RectTransform that it rotates around.|5=<pre>Space.Host.ExecutingObject.RectTransform.pivot= Vector.New(0.4,0.4,0)</pre>}}
  
{{ScriptFunction|SVector|sizeDelta|{ get;set; }|The size of this RectTransform relative to the distances between the anchors.|5=<pre></pre>}}
+
{{ScriptFunction|SVector|sizeDelta|{ get;set; }|The size of this RectTransform relative to the distances between the anchors.|5=<pre>Space.Host.ExecutingObject.RectTransform.sizeDelta= Vector.New(90,90,0)</pre>}}
  
  

Revision as of 01:31, 14 July 2021

Members

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.


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


SetParent

void SetParent (SGameObject parent, bool worldPositionStays);

Set the parent of the transform.

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


SetSizeWithCurrentAnchors

void SetSizeWithCurrentAnchors (bool vertical, float size);

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

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



Properties

anchoredPosition

SVector anchoredPosition { get;set; }

The position of the pivot of this RectTransform relative to the anchor reference point.

Space.Host.ExecutingObject.RectTransform.anchoredPosition = Vector.New(10,50,0)


anchoredPosition3D

SVector anchoredPosition3D { get;set; }

The 3D position of the pivot of this RectTransform relative to the anchor reference point.

Space.Host.ExecutingObject.RectTransform.anchoredPosition3D = Vector.New(10,50,10)


anchorMax

SVector anchorMax { get;set; }

The normalized position in the parent RectTransform that the upper right corner is anchored to.

Space.Host.ExecutingObject.RectTransform.anchorMax= Vector.New(0.8,0.8,0)


anchorMin

SVector anchorMin { get;set; }

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

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


offsetMax

SVector offsetMax { get;set; }

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

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


offsetMin

SVector offsetMin { get;set; }

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

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


pivot

SVector pivot { get;set; }

The normalized position in this RectTransform that it rotates around.

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


sizeDelta

SVector sizeDelta { get;set; }

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

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