Breakroom is now Sinewave Campus. Book a meeting

SRectTransform

ClientComposants
Dans cette classeSetParent
  1. Fonctions
  2. SetParent
  3. SetInsetAndSizeFromParentEdge
  4. SetSizeWithCurrentAnchors
  5. Propriétés
  6. Rect
  7. anchorMin
  8. anchorMax
  9. anchoredPosition3D
  10. anchoredPosition
  11. sizeDelta
  12. pivot
  13. offsetMin
  14. offsetMax
  15. GameObject
Membres 13
FonctionSetParentSet the parent of the transform.
FonctionSetInsetAndSizeFromParentEdgeSet the distance of this rectangle relative to a specified edge of the parent rectangle, while also setting its size.
FonctionSetSizeWithCurrentAnchorsMakes the RectTransform calculated rect be a given size on the specified axis.
PropriétéRect–
PropriétéanchorMinThe normalized position in the parent RectTransform that the lower left corner is anchored to.
PropriétéanchorMax–
PropriétéanchoredPosition3D–
PropriétéanchoredPosition–
PropriétésizeDeltaThe size of this RectTransform relative to the distances between the anchors.
PropriétépivotThe normalized position in this RectTransform that it rotates around.
PropriétéoffsetMinThe offset of the lower left corner of the rectangle relative to the lower left anchor.
PropriétéoffsetMaxThe offset of the upper right corner of the rectangle relative to the upper right anchor.
PropriétéGameObject–

Fonctions​

SetParent​

void SetParent(SGameObject parent, bool worldPositionStays)

Set the parent of the transform.

Paramètres

NomTypeValeur par défaut
parentSGameObject–
worldPositionStaysbool–

Valeurs de retour

void

Exemple

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.

Paramètres

NomTypeValeur par défaut
edgeint–
insetfloat–
sizefloat–

Valeurs de retour

void

Exemple

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.

Paramètres

NomTypeValeur par défaut
verticalbool–
sizefloat–

Valeurs de retour

void

Exemple

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

Propriétés​

RectLecture seule​

SRect Rect {get; }

Exemple

Lua
rect = Space.Host.ExecutingObject.RectTransform.Rect

anchorMin​

SVector anchorMin {get; set; }

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

Exemple

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

anchorMax​

SVector anchorMax {get; set; }

Exemple

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

anchoredPosition3D​

SVector anchoredPosition3D {get; set; }

Exemple

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

anchoredPosition​

SVector anchoredPosition {get; set; }

Exemple

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

sizeDelta​

SVector sizeDelta {get; set; }

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

Exemple

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

pivot​

SVector pivot {get; set; }

The normalized position in this RectTransform that it rotates around.

Exemple

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

offsetMin​

SVector offsetMin {get; set; }

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

Exemple

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

offsetMax​

SVector offsetMax {get; set; }

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

Exemple

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

GameObjectLecture seule​

SGameObject GameObject {get; }

Exemple

Lua
theGameObject = Space.Host.ExecutingObject.RectTransform.GameObject