Leo Lou CCLabelTTF::labelWithString crashes randomly
Posts 53
Added by Leo Lou over 1 year ago

My game crashes with
CCLabelTTF* label = CCLabelTTF::labelWithString("No Internet Connection.", CCSize(100,100), CCTextAlignmentCenter, "Thonburi", 20);

but when i modify the string, it works.
(in android only)

Minggo Zhang RE: CCLabelTTF::labelWithString crashes randomly
Posts 1641
Added by Minggo Zhang over 1 year ago

What you said means that, the crash is something about the content of the string.
It is so strange.

RongHong Huang RE: CCLabelTTF::labelWithString crashes randomly
Posts 171
Added by RongHong Huang over 1 year ago

to Leo Lou:
are you sure it works when you modify that string?

i have tested this on g7.
and it worked well when the font is Marker Felt, but failed when the font is Thonburi, although i modified the string.

maybe Thonburi is not supported by android

Steven J RE: CCLabelTTF::labelWithString crashes randomly
Posts 11
Added by Steven J about 1 year ago

This happens a lot, and often crashes at seemingly different spots, always one of three.

The arrayMakeObjectsPerformSelector area,
a CCTouch callback,
or somewhere on the label creation.

If you allocate a lot of labels, or your scenes have them in general, chances are you'll crash a lot. I can run for 5 min. sometimes and 1 second other times.

It's hard to trace since it's usually buried in system calls after setNextScene, within the touches callbacks. Now, any good tutorials on using a BMFont? The official cocos2d tutorial (not 2d-x) tries, but their grammar states "A or B, A is outdated, let's use A".. anywho, seems to be "the fix" for those


(1-3/3)