new UITransform()
UI Transform Component is responsible for the position, rotation and width and height of a UI element. Every UI element must have a transform component. Without a transform component, the UI element will not be rendered. Note Scale is not supported for UI elements. Thus normal Transform Component cannot be used for UI elements, as it has scale instead of width and height. All the UI Rendering is done with pixels, so the position and width and height are in pixels. Position vector is replaced by x and y.
Name | Type | Default | Description |
---|---|---|---|
x | number | 0 | The x position of the UI element. |
y | number | 0 | The y position of the UI element. |
rotation | number | 0 | The rotation of the UI element in degrees. |
width | number | 10 | The width of the UI element. |
height | number | 10 | The height of the UI element. |
- Source
Extends
Members
(readonly) properties
The entity that this component is attached to.
- Inherited From
- Source