Hello!
I’m using cocos2d-x 2.0.4 for my game.
CCLabelTTF works well on both of device and simulator in iOS 6. But when i test it in iOS 7.0, it doesn’t work.
Here is my code.
int nScore = 10;
char str[50];
sprintf(str, “SCORE : %d”, nScore);
CCLabelTTF *lbl = CCLabelTTF::create(str, “Marker Felt”, 50);
lbl~~>setPosition);
lbl~~>setColor(ccRED);
this~~>addChild;
Score doesn’t show now. But it shows in iOS 6.
One more strange problem.
If i change above code like this, it works.
CCLabelTTF lbl = CCLabelTTF::create;
lbl~~>setPosition);
lbl~~>setColor;
this~~>addChild;
But if i change this code like below again, it doesn’t work.
CCLabelTTF *lbl = CCLabelTTF::create;
lbl~~>setPosition);
lbl~~>setColor;
this~~>addChild;
Maybe it’s case sensitive issue.
Finally below code doesn’t work too even if text is upper case. I only added number 10.
CCLabelTTFlbl = CCLabelTTF::create;
lbl~~>setPosition(ccp(size.width*0.5, size.height*0.88));
lbl~~>setColor;
this~~>addChild(lbl);
Any help will be appreciate.
Thanks in advance.
Yin.