display long text in CCScrollView

Hi,

can anyone please show me the solution for following its really urgent. I have very long text. I want to display it in limited space, and for extra text i should give option of scrolling to user. Can u please show me the solution for it.

Thanks in advance.

1 Like

and for extra text i should give option of scrolling to user

What does this mean? The text outside the scrollview will not be shown of course.

James Chen wrote:

> and for extra text i should give option of scrolling to user
>
What does this mean? The text outside the scrollview will not be shown of course.

the text outside the scrollview, user can scroll the view to see ….e.g : 游戏里面与NPC对话,可能剧情比较长,用户可以把任务剧情往下滑,继续查看…这样子…

Just add multi-line CCLabelTTF to CCScrollView. Does the way can’t work?

James Chen wrote:

Just add multi-line CCLabelTTF to CCScrollView. Does the way can’t work?

Can this operation be done in Cocosbuilder? or only by code? it seems that only ccb files can be added to the container. Thanks.

MacChina Mac wrote:

Hi,
>
can anyone please show me the solution for following its really urgent. I have very long text. I want to display it in limited space, and for extra text i should give option of scrolling to user. Can u please show me the solution for it.
>
Thanks in advance.

http://www.cocos2d-x.org/boards/6/topics/33732
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)