Search Unity

TextMesh Pro Text aligned to left and being centered in the end.

Discussion in 'UGUI & TextMesh Pro' started by ihgyug, Dec 26, 2019.

  1. ihgyug

    ihgyug

    Joined:
    Aug 5, 2017
    Posts:
    194
    Hi all,

    I would like my text to be aligned to the left and flow to the right, but with the ending result always being perfectly centered.

    What would be the best way to do so?
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Can you provide an example of this?
     
  3. ihgyug

    ihgyug

    Joined:
    Aug 5, 2017
    Posts:
    194
    The mspace tag (<mspace=x></mspace>), paired with alignment setting to left, helped me achieve the effect I desired.
    I simply look at the message string, and change the boundaries of the text accordingly.
    The ending result will be centered thanks to the mspace tag.
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I have been / am traveling over the next few days (due to family emergency). I should be able to provide feedback over the weekend or early next week.