UI Text overflow to left

Hello,

The past few weeks i created a chatbased game in Unity (mostly UI). The game gives you a few
answer options and you can choose how you would like to respond. Than the text is typed into
the textfield (like a whatsapp or messenger textinput) with a ticker effect (letter by letter).

A problem occurs when the text is longer than the inputfield. Of course i cant make the input field bigger, otherwise it wouldnt fit in the chat-app.
I can use overflow to compensate this, but than the new text is typed outside the inputfield. An other option is to set text alignment on right. But than the text is typed from right to left, instead of left to right (at least the overflow functions than) but it isnt an option either.

Is there a way to let the text overflow to the left side so that the last characters typed are visible and the first one disappear to the left side? I tried a lot with scroll-rects, contentsize fitters etc but couldnt figure out how to do it.

I attached a simple paint png to clearify.
The black rectangle is the inputfield with fixed width and the red text should be invisible in the 3e example.

If something isnt clear, please ask

Thanks in advance

Jeffrey

Hi Jefferey,

Were you ever able to figure this out? I have been struggling with the same.

Thanks,
Onur

Have you tried using TextMeshPro and the TMP Input Field to see if you get the desired behavior?

I actually have a similar or opposite problem with TextMeshPro, but that might be the thing you’re looking for.
See here: