I do not know if it’s possible, but I have an variable array like this:
The third child variable has a lot of text, and I would like to load this text in a textobject, but with automatic line break. Is it possible?
For example, this is the text as a string of a variable(array):
“My name is hordan, and I need some water, please. Can you help me? Just water, please. Just water…”
Look the result loaded in a textobject:
how to load this big text in a textobject, with automatic line break?
This is the action I am using:
I’ve found another example in the forum, but the we need to indicate what comes in the next line with NewLine()
With xml or json the line break can be done inside the file( but I could not solve the html5 problem to load a json file ), so I am using strings inside Gdevelop.
There are no automatic line break in GDevelop as, currently, the text object size is changed according to the content of the text object (this is useless to resize the text when you edit your game).
But it would be nice to have that feature : the user can activate this feature from the text object editor, if it’s enabled, then, the user can resize the text object to define its boundaries.
Yeah, it would be a nice feature. So for now, my only solution is to divide one text dialog into 4 child variables, each one containing one line of the dialog; and load then in the textobject, with the new lines. Like this:
VariableString(Droid.falas.fala3.L1) + NewLine() + VariableString(Droid.falas.fala3.L2) + NewLine() +VariableString(Droid.falas.fala3.L3)
The L1, L2, L3 are the child variables containing the lines of the dialog.
Hard work! But ok.