Version: 5.3 (switch to 5.4b)
IdiomaEnglish
  • C#
  • JS

Idioma de script

Selecciona tu lenguaje de programación favorito. Todos los fragmentos de código serán mostrados en este lenguaje.

RectTransform

class in UnityEngine

/

Hereda de:Transform

Sugiere un cambio

¡Éxito!

Gracias por ayudarnos a mejorar la calidad de la documentación de Unity. A pesar de que no podemos aceptar todas las sugerencias, leemos cada cambio propuesto por nuestros usuarios y actualizaremos los que sean aplicables.

Cerrar

No se puedo enviar

Por alguna razón su cambio sugerido no pudo ser enviado. Por favor <a>intente nuevamente</a> en unos minutos. Gracias por tomarse un tiempo para ayudarnos a mejorar la calidad de la documentación de Unity.

Cerrar

Cancelar

Cambiar al Manual

Descripción

Position, size, anchor and pivot information for a rectangle.

RectTransforms are used for GUI but can also be used for other things. It's used to store and manipulate the position, size, and anchoring of a rectangle and supports various forms of scaling based on a parent RectTransform.

Variables

anchoredPositionThe position of the pivot of this RectTransform relative to the anchor reference point.
anchoredPosition3DThe 3D position of the pivot of this RectTransform relative to the anchor reference point.
anchorMaxThe normalized position in the parent RectTransform that the upper right corner is anchored to.
anchorMinThe normalized position in the parent RectTransform that the lower left corner is anchored to.
offsetMaxThe offset of the upper right corner of the rectangle relative to the upper right anchor.
offsetMinThe offset of the lower left corner of the rectangle relative to the lower left anchor.
pivotThe normalized position in this RectTransform that it rotates around.
rectThe calculated rectangle in the local space of the Transform.
sizeDeltaThe size of this RectTransform relative to the distances between the anchors.

Funciones Públicas

GetLocalCornersGet the corners of the calculated rectangle in the local space of its Transform.
GetWorldCornersGet the corners of the calculated rectangle in world space.
SetInsetAndSizeFromParentEdgeSet the distance of this rectangle relative to a specified edge of the parent rectangle, while also setting its size.
SetSizeWithCurrentAnchorsMakes the RectTransform calculated rect be a given size on the specified axis.

Delegados

ReapplyDrivenPropertiesDelegate used for the reapplyDrivenProperties event.

Miembros heredados

Variables

gameObjectThe game object this component is attached to. A component is always attached to a game object.
tagEl tag de este game object.
transformThe Transform attached to this GameObject (null if there is none attached).
hideFlagsShould the object be hidden, saved with the scene or modifiable by the user?
nameEl nombre del objeto.
childCountThe number of children the Transform has.
eulerAnglesThe rotation as Euler angles in degrees.
forwardThe blue axis of the transform in world space.
hasChangedHas the transform changed since the last time the flag was set to 'false'?
localEulerAnglesThe rotation as Euler angles in degrees relative to the parent transform's rotation.
localPositionPosition of the transform relative to the parent transform.
localRotationThe rotation of the transform relative to the parent transform's rotation.
localScaleThe scale of the transform relative to the parent.
localToWorldMatrixMatrix that transforms a point from local space into world space (Read Only).
lossyScaleThe global scale of the object (Read Only).
parentThe parent of the transform.
positionThe position of the transform in world space.
rightThe red axis of the transform in world space.
rootReturns the topmost transform in the hierarchy.
rotationThe rotation of the transform in world space stored as a Quaternion.
upThe green axis of the transform in world space.
worldToLocalMatrixMatrix that transforms a point from world space into local space (Read Only).

Funciones Públicas

BroadcastMessageLlama al método denominado methodName de todos los MonoBehaviour en este game objecto en cualquiera de sus hijos.
CompareTag¿Este game object está etiquetado con tag?
GetComponentDevuelve un componente de tipo type si el game object tiene a alguno adjuntado, o null si no lo tiene.
GetComponentInChildrenReturns the component of Type type in the GameObject or any of its children using depth first search.
GetComponentInParentReturns the component of Type type in the GameObject or any of its parents.
GetComponentsReturns all components of Type type in the GameObject.
GetComponentsInChildrenReturns all components of Type type in the GameObject or any of its children.
GetComponentsInParentReturns all components of Type type in the GameObject or any of its parents.
SendMessageLlama al método denominado methodName en cada MonoBehaviour de este game object.
SendMessageUpwardsLlama al método denominado methodName en todos los MonoBehaviour de este juego y en todos los ancestros del behaviour.
GetInstanceIDReturns the instance id of the object.
ToStringDevuelve el nombre del objeto.
DetachChildrenUnparents all children.
FindFinds a child by name and returns it.
GetChildReturns a transform child by index.
GetSiblingIndexGets the sibling index.
InverseTransformDirectionTransforms a direction from world space to local space. The opposite of Transform.TransformDirection.
InverseTransformPointTransforms position from world space to local space.
InverseTransformVectorTransforms a vector from world space to local space. The opposite of Transform.TransformVector.
IsChildOfIs this transform a child of parent?
LookAtRotates the transform so the forward vector points at /target/'s current position.
RotateApplies a rotation of eulerAngles.z degrees around the z axis, eulerAngles.x degrees around the x axis, and eulerAngles.y degrees around the y axis (in that order).
RotateAroundRotates the transform about axis passing through point in world coordinates by angle degrees.
SetAsFirstSiblingMove the transform to the start of the local transform list.
SetAsLastSiblingMove the transform to the end of the local transform list.
SetParentSet the parent of the transform.
SetSiblingIndexSets the sibling index.
TransformDirectionTransforms direction from local space to world space.
TransformPointTransforms position from local space to world space.
TransformVectorTransforms vector from local space to world space.
TranslateMoves the transform in the direction and distance of translation.

Funciones Estáticas

DestroyElimina un gameobject, componente o asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadMakes the object target not be destroyed automatically when loading a new scene.
FindObjectOfTypeDevuelve el primer objeto activo cargado de tipo type.
FindObjectsOfTypeDevuelve una lista de todos los objetos activos cargados de tipo type.
InstantiateDevuelve el nombre del objeto.

Operadores

bool¿Existe el objeto?
operator !=Compares if two objects refer to a different object.
operator ==Compares two object references to see if they refer to the same object.