2D Toolkit Forum
2D Toolkit => Support => Topic started by: aphexyuri on May 10, 2012, 07:37:53 pm
-
Hi,
I'm dynamically setting the value of a TextMesh, but the text needs to have multiple lines.
And example of text would be:
public string exampleTxt = "Hello,\nhow are you";
I've tried both \n and \r chars but it does not seem to be working. Can this be done, and if so how?
Thanks,
Yuri
-
That should just work (\n). Check out sample #5 - animation. In tk2dDemoAnimationController.cs, void AnimationEventDelegate(tk2dAnimatedSprite sprite, tk2dSpriteAnimationClip clip, tk2dSpriteAnimationFrame frame, int frameNum),
it constructs a multiline string and sets it to a textmesh.
Perhaps there is an issue with encoding?
Another thing that could be an issue is the number of characters, perhaps its clipping at 6 characters?
-
Thanks Unikron, got it!
Yes, the Max Chars was not enough for the entire 2nd row, and thus it did not show :)