Center elements

Use properties to center an element in its parent.

To center an element in its parent container you can set its properties as described in Table 1

Table 1. Centering an element
Property Value
x max/2
y max/2
anchorX 0.5
anchorY 0.5

An X and Y value of max/2 sets the x and y coordinates of the element to the maximum of its parent container divided by 2. An Anchor X and Anchor Y value of 0.5 sets the attachment point to the center of the element.