diff --git a/cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java b/cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java index fcd4598cde..2a0a915a02 100644 --- a/cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java +++ b/cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java @@ -128,7 +128,7 @@ public class Cocos2dxBitmap { if ( shadow ) { - int shadowColor = 0xff7d7d7d; + int shadowColor = 0x54000000; paint.setShadowLayer(shadowBlur, shadowDX, shadowDY, shadowColor); bitmapPaddingX = Math.abs(shadowDX); diff --git a/cocos2dx/platform/ios/CCImage.mm b/cocos2dx/platform/ios/CCImage.mm index cdd3a8a2c4..6c5f7e0a8c 100644 --- a/cocos2dx/platform/ios/CCImage.mm +++ b/cocos2dx/platform/ios/CCImage.mm @@ -365,10 +365,14 @@ static bool _initWithString(const char * pText, cocos2d::Image::ETextAlign eAlig textOrigingY = startH - shadowStrokePaddingY; } + CGRect rect = CGRectMake(textOriginX, textOrigingY, textWidth, textHeight); + CGContextBeginTransparencyLayerWithRect(context, rect, NULL); // actually draw the text in the context // XXX: ios7 casting - [str drawInRect:CGRectMake(textOriginX, textOrigingY, textWidth, textHeight) withFont:font lineBreakMode:NSLineBreakByWordWrapping alignment:(NSTextAlignment)align]; + [str drawInRect: rect withFont:font lineBreakMode:NSLineBreakByWordWrapping alignment:(NSTextAlignment)align]; + + CGContextEndTransparencyLayer(context); // pop the context UIGraphicsPopContext();