在用到CCLabelTTF 的setDimensions方法时在换行处总是丢掉一个汉字,win32下没问题,android上每次都是,解决:
用eclipse打开Cocos2dxBitmap.java类,在300行左右:
/* Remove spaces at the beginning of a new line. */
while (pString.indexOf(i++) == ' ') {
;
}
改成
/* Remove spaces at the beginning of a new line. */
while (pString.indexOf(i) == ' ') {
i++;
}
while (pString.indexOf(i++) == ' ') {
;
}
改成
/* Remove spaces at the beginning of a new line. */
while (pString.indexOf(i) == ' ') {
i++;
}
再重新打包,就可以了