I get the following error when trying to create a MenuItemAtlasFont in cocos2dx-2.2.1:
My call: var item = cc.MenuItemAtlasFont.create(‘My text’, ‘font.fnt’, 200, 100, ’ ');
My project runs fine without that line of code
My fnt file works in LabelBMFont
My fnt file is in txt format (non xml)
My fnt file was generated with [Littera][1]
My app crashes with that line
I tried to change the parameter ‘font.fnt’ to ‘font.png’ (the two files exists) and got no crash, but the item doesn’t draw (I’ve added it to a Menu with existing and visible items).
TIA
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'google/occam/mako:4.3/JWR66V/737497:user/release-keys'
Revision: '11'
pid: 25507, tid: 25548, name: Thread-1731 >>> com.my.Project <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000038
r0 00000038 r1 7542e430 r2 00000000 r3 73f917c5
r4 758db30c r5 758db210 r6 75a1a130 r7 00000001
r8 742b8b68 r9 00000000 sl 76660b40 fp 76661e80
ip 40585ad8 sp 744109f8 lr 73f576bf pc 73f909d0 cpsr 00000030
d0 0015001600170016 d1 001b001a00190018
d2 001d001c0019001a d3 001d001e001f001e
d4 0000000000000000 d5 0000000000000000
d6 0000000000000000 d7 0000000000000000
d8 0000000000000000 d9 0000000000000000
d10 0000000000000000 d11 0000000000000000
d12 0000000000000000 d13 0000000000000000
d14 0000000000000000 d15 0000000000000000
d16 0003000200010000 d17 0005000400010002
d18 0005000600070006 d19 000b000a00090008
d20 000d000c0009000a d21 000d000e000f000e
d22 0013001200110010 d23 0015001400110012
d24 3f696b8927e8efc4 d25 547d42aea2879f2e
d26 3ff0000000000000 d27 3ff0000000000000
d28 3ff0000000000000 d29 0000000000000001
d30 4024000000000000 d31 4000000000000000
scr 60000012
backtrace:
#00 pc 007c49d0 /data/app-lib/com.my.Project-2/libcocos2djs.so (cocos2d::CCTexture2D::hasPremultipliedAlpha()+1)
#01 pc 0078b6bb /data/app-lib/com.my.Project-2/libcocos2djs.so (cocos2d::CCAtlasNode::updateBlendFunc()+14)
#02 pc 0078b759 /data/app-lib/com.my.Project-2/libcocos2djs.so (cocos2d::CCAtlasNode::initWithTexture(cocos2d::CCTexture2D*, unsigned int, unsigned int, unsigned int)+80)
#03 pc 0079b0f9 /data/app-lib/com.my.Project-2/libcocos2djs.so (cocos2d::CCLabelAtlas::initWithString(char const*, cocos2d::CCTexture2D*, unsigned int, unsigned int, unsigned int)+68)
#04 pc 0079b155 /data/app-lib/com.my.Project-2/libcocos2djs.so (cocos2d::CCLabelAtlas::initWithString(char const*, char const*, unsigned int, unsigned int, unsigned int)+36)
#05 pc 007a56f1 /data/app-lib/com.my.Project-2/libcocos2djs.so (cocos2d::CCMenuItemAtlasFont::initWithString(char const*, char const*, int, int, char, cocos2d::CCObject*, void (cocos2d::CCObject::*)(cocos2d::CCObject*))+176)
#06 pc 007a5783 /data/app-lib/com.my.Project-2/libcocos2djs.so (cocos2d::CCMenuItemAtlasFont::create(char const*, char const*, int, int, char, cocos2d::CCObject*, void (cocos2d::CCObject::*)(cocos2d::CCObject*))+78)
#07 pc 007a57ab /data/app-lib/com.my.Project-2/libcocos2djs.so (cocos2d::CCMenuItemAtlasFont::create(char const*, char const*, int, int, char)+18)
#08 pc 00222d49 /data/app-lib/com.my.Project-2/libcocos2djs.so (js_cocos2dx_CCMenuItemAtlasFont_create(JSContext*, unsigned int, JS::Value*)+192)
stack:
744109b8 768c6c40
744109bc 73f9194b /data/app-lib/com.my.Project-2/libcocos2djs.so (cocos2d::CCTextureAtlas::mapBuffers()+78)
744109c0 75a1a130
744109c4 7542e430
744109c8 75a1a130
744109cc 73f91999 /data/app-lib/com.my.Project-2/libcocos2djs.so (cocos2d::CCTextureAtlas::setupVBO()+20)
744109d0 75a1a130
744109d4 73f91a93 /data/app-lib/com.my.Project-2/libcocos2djs.so (cocos2d::CCTextureAtlas::initWithTexture(cocos2d::CCTexture2D*, unsigned int)+230)
744109d8 74192b30 /data/app-lib/com.my.Project-2/libcocos2djs.so
744109dc 00000000
744109e0 76661e80
744109e4 400f6be5 /system/lib/libc.so (malloc+12)
744109e8 00000303
744109ec 758db30c
744109f0 df0027ad
744109f4 00000000
#00 744109f8 758db30c
........ ........
#01 744109f8 758db30c
744109fc 73f5775d /data/app-lib/com.my.Project-2/libcocos2djs.so (cocos2d::CCAtlasNode::initWithTexture(cocos2d::CCTexture2D*, unsigned int, unsigned int, unsigned int)+84)
#02 74410a00 758db210
74410a04 00000000
74410a08 000000c8
74410a0c 758db210
74410a10 768c6558
74410a14 00000000
74410a18 000000c8
74410a1c 73f670fd /data/app-lib/com.my.Project-2/libcocos2djs.so (cocos2d::CCLabelAtlas::initWithString(char const*, cocos2d::CCTexture2D*, unsigned int, unsigned int, unsigned int)+72)
memory near r1: