textmeshpro: how do you center the text box around the pivot?

8428227--1115748--upload_2022-9-9_8-39-41.png
none of the rect coordinates change as i move the handles so that must be elsewhere

8428227--1115751--upload_2022-9-9_8-40-11.png

The text box should always be centered around the pivot. That is unless you changed the margins with is the yellow box.

The white dots are to control the margins whereas hovering over the lines between those dots changes the RectTransform size as seen below.

To Reset the margins, look in the Extra Settings panel of the text component as seen below. This is where you can change their values numerically instead of via the white dots / widgets.

8429411--1116008--upload_2022-9-9_23-44-36.png

1 Like

thanks.
what are margins for?

Just like on a piece of paper, they allow you to offset the text within the RectTransform.

Think of the RectTransform as your piece of paper and the margins as the thing that allows you to offset the text within it.

Below is a screenshot from Microsoft Word where I selected / highlighted the text. Notice how the descender of the ā€œjā€ is sticking outside of the margin.

8430572--1116299--upload_2022-9-10_16-22-3.png

If you had a masking component on that text, the descender of the ā€˜jā€™ would get clipped. So having the ability to offset the text within the page / RectTransform can be pretty useful.

I see. thanks.