Page 1 of 1

[Fixed] Affect NewLine() while changing text

PostPosted: Mon 12 Feb 2018, 09:47
by Jeje2201
Hi, im confront to a problem.
Im making a text appear when the player is in collision with a panel.
When the text appear, I change it to a variable that is store in the panel.
So when the player hit a panel, a text appear with the text store in the variable of the panel the player is in collision with.
Im doing this way so whenever the player hit a new panel, I can change the text variable of each panel so the text appear depend what panel he hit. So far it work well.
Here is the Gdevelop part : http://prntscr.com/idio3o
But what Im trying to do is to insert new line in the text that appear.
So in the text variable of the pannel Im doing something like : "test"+NewLine()+"test2"
But it make this : http://prntscr.com/idimvw
Is there any way to fix this ?

Re: Affect NewLine() while changing text

PostPosted: Tue 13 Feb 2018, 02:01
by MattLB
I can't see anything wrong in what you've shown, so the problem may be in the action where you set the value of the object variable Texte.

Re: Affect NewLine() while changing text

PostPosted: Tue 13 Feb 2018, 12:42
by Jeje2201
Well the variable of the panel is like that: http://prntscr.com/ie300f
And there is only one way to change the text of a text object: http://prntscr.com/ie30vt
So I don't see any other way to do

Re: Affect NewLine() while changing text

PostPosted: Tue 13 Feb 2018, 14:25
by ddabrahim
Inside the variable panel expressions can not be used as default values, only string or number value can be used so even if you enter an expression as default value it is considered a string I guess.

Set the value of the variable using an event instead.

Affect NewLine() while changing text

PostPosted: Tue 13 Feb 2018, 20:26
by Jeje2201
I just found a solution the most basic possible...
You can actual do a new line in the text editor of Gd5..
Here is the exemple: http://prntscr.com/ieaa5j
And so the text = this variable and it work perfectly
Here : http://prntscr.com/ieaaj9
So yeah, it's fix not on purpose haha :lol:

Re: [Fixed] Affect NewLine() while changing text

PostPosted: Wed 14 Feb 2018, 17:47
by Lizard-13
Cool, I didn't know that :D