How to align text ?
Hello, i try to find a way to align my UI text, by shifting some sentences right (as for a list) without manually placing spaces. How could i do this ? "\t" only works for one line but i want that all the sentence go right. Thanks
Not tested: A sort of visual way might be to have a normal empty parent, and shifted-right empty parent. Change the parent using SetParent(whichEmpty, true);. The "true" tells it to recalculate position based on the new parent.
Answer by JonPQ · Aug 23, 2019 at 11:37 PM
set the test alignment to "Right Justify" then all text will line up to the right edge of parent Rect Transform. if you aren't using it... use TextMeshPro, for your text needs.
I don't want the text to line up to the right edge, i just want a sentence to move slightly to the right. I'd like to not use Text$$anonymous$$eshPro for now.
Answer by cs120319992 · Aug 26, 2019 at 09:19 AM
Example:
"\n\tHelloo" "\n\tIt's me"
If line is very long, calculate the length of each line, and add programmatically \n\t
Hi, thanks, but how do i calculate the length of each line, as characters have different sizes ?
Your answer
Follow this Question
Related Questions
TextAlignmentOptions is bugged if set via inspector (Unity 2020.3.2f1) 1 Answer
Why does text vertical alignment work incorrectly with low font sizes? 1 Answer
Text alignment not working 2 Answers
Custom fonts not working in build 0 Answers
how to use scientific values in inputfield unit or restrict only some letters 0 Answers