UITransform

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.

Properties
NameTypeDefaultDescription
xnumber0

The x position of the UI element.

ynumber0

The y position of the UI element.

rotationnumber0

The rotation of the UI element in degrees.

widthnumber10

The width of the UI element.

heightnumber10

The height of the UI element.

Extends

Members

(readonly) properties

The entity that this component is attached to.

Inherited From