建立標籤,這種風格:CCLabelBMFont失去拖尾字符每個換行符
CCLabelBMFont *label1_=
[CCLabelBMFont labelWithString:@"description: -" fntFile:@"comicsans.fnt" width:270 alignment:kCCTextAlignmentLeft];
和:
[label1_ setString:
@"someText\n and some newline \nand another new line too but this is last"];
這個字符串有新行seen.and 2個轉義字符,當我設置林失去了最後的2個字 其顯示這樣的事情
someText
and some newline
and another new line too but this is la
最後兩封信以某種方式丟失了。 什麼可能是這個問題的原因? a cocos2d v2.1(stable)bug或恐怖片中的im?如果是這樣,我該怎麼辦?
\ r與\ n的效果相同\ n 不知道爲什麼。可能是你知道的。
如果我不使用\ r \ n轉義字符; CCLabelFont字符串顯示正確的字符串,不會丟失任何數量的字符拖尾。
所以我暫時的解決方案是從字符串修復問題中刪除轉義字符。 但這並沒有解決Cocos2d v2.1(stable)的bug。 我認爲如果有\ n轉義字符,CCLabel類的類不能計算不工作穩定。