I noted that CCLabelTTF’s stroke is not working in ios7.
And I found a solution of cocos2d-iphone(http://www.cocos2d-iphone.org/forums/topic/cclabelttf-stroke-not-working-in-ios-7)
I port it to cocos2d-x.
You should replace the code below (cocos2dx/platform/ios/CCImage.mm)
// actually draw the text in the context
// XXX: ios7 casting
[str drawInRect:CGRectMake(textOriginX, textOrigingY, textWidth, textHeight) withFont:font lineBreakMode:NSLineBreakByWordWrapping alignment:(NSTextAlignment)align];
with
if([[[UIDevice currentDevice] systemVersion] compare:@"7.0" options:NSNumericSearch] != NSOrderedAscending)
{
NSMutableParagraphStyle *_paragraphStyle = [[[NSMutableParagraphStyle alloc] init] autorelease];
_paragraphStyle.alignment = (NSTextAlignment)align;
_paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping;
[str drawInRect:CGRectMake(textOriginX, textOrigingY, textWidth, textHeight)
withAttributes:@{NSFontAttributeName: font,
NSStrokeWidthAttributeName: [NSNumber numberWithFloat:-pInfo->strokeSize*(100.0f/((UIFont*)font).pointSize)],
NSForegroundColorAttributeName:[UIColor colorWithRed:pInfo->tintColorR
green:pInfo->tintColorG
blue:pInfo->tintColorB
alpha:1.0f],
NSParagraphStyleAttributeName:_paragraphStyle,
NSStrokeColorAttributeName: [UIColor colorWithRed:pInfo->strokeColorR
green:pInfo->strokeColorG
blue:pInfo->strokeColorB
alpha:1.0f]}
];
}
else
{
// actually draw the text in the context
// XXX: ios7 casting
[str drawInRect:CGRectMake(textOriginX, textOrigingY, textWidth, textHeight) withFont:font lineBreakMode:NSLineBreakByWordWrapping alignment:(NSTextAlignment)align];
}
And then, you can see the stroke in ios7.