有时候在使用cococs2dx的时候,想显示多行的文本,但是又不知道怎么做,下面我就把我最近在做项目的时候用到的方法给大家分享出来,废话不多说,下面就是cocos2dx Text 文本显示多行的方法:

1. string info     =   "Hungry Hero is a free and open source game built on Adobe Flash using Starling Framework.\n\nhttp://www.hungryherogame.com\n\n"  

2.         " The concept is very simple. The hero is pretty much always hungry and you need to feed him with food."  

3.         " You score when your Hero eats food.\n\nThere are different obstacles that fly in with a \"Look out!\""  

4.         " caution before they appear. Avoid them at all costs. You only have 5 lives. Try to score as much as possible and also"  

5.         " try to travel the longest distance.";  

6.     aboutInfo       =   LabelTTF::create(info,"微软雅黑",28,Size(500,500),TextHAlignment::LEFT);