It's to be able to display everything at once, without text overlapping.
You can then display full text in a single element viewer.
But... :/ You don't display "everything at once", since you truncate a part of your text to make it fit...
EDIT:
I mean the usage of this is when text based statement receives string of unknown length.
And when text must be in in 1 line. (layout="nobreak")
But also must not go over container. (my function)
I got it that way. And it's precisely to this that my answer apply.
When you are writing your text, you know that "here" you have a length constraint, and you write your text for it to fit.
The only case where it's needed is when you have no control over the length of the text. In my variable viewer, the text is the content of the variable. When it's a dict or a list, this content can grow really quickly. Then, yes, truncating make sense. And it's also better than a
viewport
, because the representation of a list or dict can perfectly need thousands letters (I know a game where a list is over 250,000 characters).
Technically, it shouldn't not be a problem by itself for Ren'Py to have a hundreds thousands long text in a
viewport
. But practically it would surely slowdown the game, and anyway it would be unreadable for the player. Therefore, the text is truncated, and if the player click, the list/dict will be displayed element by element. What will show its whole content and be easier to read.
But when you are the one who wrote the text, whatever if it's for a mod or a game, it's something radically different.
You know the constraints imposed by the interface design, and you write your text for it to always fit. It's the reason why most games (even AAA titles) have a letters limit when you are offered the possibility to personalize a name ; all the texts in the game are wrote for them to fit with names up to this limit.
Having to rely on a truncation feature, especially when it will rarely be used, yet only in case you know that you know in advance, is the sign of bad design, not of well thought game.
Anyway there's
viewport
s to handle those cases. But most of the time, the game design should rely on a summary/description sentence, then display the whole text "on click".
Some kind of "she have a bad opinion about you", then as detailed explanation, "you're always late on your dates, and she wonder if you hangout with her out of love, or just because you want to fuck her."
It's one of the first rules when you make a game: "If it don't fit, rewrite it".