LabelTTF long string -> WARNING: Image (2048 x 4653) is bigger than the supported 4096 x 4096


#1

LabelTTF_instruction = LabelTTF::create(str->getCString(), “Helvetica”, 20, Size(s.width, s.height), Label::HAlignment::LEFT, Label::VAlignment::TOP);

str is very long which be read from help.txt

then log show:

Cocos2d: cocos2d: WARNING: Image (2048 x 4653) is bigger than the supported 4096 x 4096
Cocos2d: LabelTTF_instruction size(0.000000, 0.000000)


display long text in CCScrollView
#2

In general, you should minimize videomemory usage in your game. Why you’re using so big text, what it means for user?


#3

Sergey Shambir wrote:

In general, you should minimize videomemory usage in your game. Why you’re using so big text, what it means for user?

i just want to load all game instruction by uilabelttf. do you have more good method to show game instruction?


#4

At first, you can split instruction to several chunks where each chunk has fixed size. But there is perfect solution that minimazes memory usage and perfomance drop: since you instruction have 26\ letters\ and10 puntuaction chars, you can use CCLabelAtlas. This class needs special font which can be prepared by some software, but it keeps only one texture for ~36 characters instead of whole text.

P.S. See also [[Text_Labels|this wiki page]].