Text Alignment

Hi,

I was wondering if I have to wait for the transform: pivot to be supported before this is possible? Right now the text in a VisualElement only goes below no matter what alignment I have set in UIBuilder.

This is the effect I am looking for. (This is using TMP text.)

5wsaal

Thanks!

Up

I was able to get something close to what you like by using elements with these styles:

.centered-label-parent {
    height: 332px;
    width: 348px;
    flex-direction: column-reverse;
    align-items: center;
}

.centered-label {
    -unity-text-align: upper-center;
}

7027723--832576--centered-label.gif

If you still need a pivot, you can workaround not having transform-origin by adding a empty, 0x0, parent element with overflow: visible.
Then set its transform.position to the pivot position, then set the child’s transform.position to -pivot

2 Likes

Thanks!