Monday, December 8, 2014

Cocos2D-X Display Long Text

When displaying long text in Cocos2D-X, it doesn't seem possible to use a single Label when the text is quite long (e.g. 2000+ characters), as the Label goes completely blank instead of displaying text. Maybe it is because Cocos2D-X uses a texture for this and this somehow blew the texture size limit. To display long text in Cocos2D-X, use multiple labels e.g. one for each paragraph.

Note: to get the height of each label so as to know where to position the next one, call "getBoundingBox()" on the label.

No comments:

Post a Comment