Support => NGUI 3 Support => Topic started by: aidji on October 03, 2013, 08:58:34 PM
Title: 2.7.0 no linebreak with UILabel
Post by: aidji on October 03, 2013, 08:58:34 PM
i just upgraded from 2.5.1 from 2.7.0, i setup my labels by code it was working well with one label for many lines but since the update the linebreak \n is not working anymore (http://image.noelshack.com/fichiers/2013/40/1380854381-bugngui.png) did i missed something? how should i deal with this problem?
Title: Re: 2.7.0 no linebreak with UILabel
Post by: aidji on October 03, 2013, 11:41:29 PM
well i checked and my last project with older NGUI version dont have this problem, seems that there is a bug or something with label changed?
i have an other panel with translated txt that work correctly for exemple:
tuto7 =[SHIELD] It protect your \nbody from being Hit!
after being translated into the label display
[SHIELD] It protect your
body from being Hit!
Title: Re: 2.7.0 no linebreak with UILabel
Post by: ArenMook on October 04, 2013, 02:00:20 AM
You need to do your own string.Replace("\\n", "\n") before setting the label's text. You're feeding it two characters for a newline, when a newline is a single escaped character (\n).