From 6e2caf1c7842803f38a45f6b55a7a005449cf414 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Tue, 8 Jul 2014 10:31:14 +0800 Subject: [PATCH] fixed can's set color for LabelTTF correctly on IOS. --- cocos/platform/ios/CCDevice.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/platform/ios/CCDevice.mm b/cocos/platform/ios/CCDevice.mm index fb14b01f71..f04767cb74 100644 --- a/cocos/platform/ios/CCDevice.mm +++ b/cocos/platform/ios/CCDevice.mm @@ -348,7 +348,7 @@ static bool _initWithString(const char * text, cocos2d::Device::TextAlign align, } // text color - CGContextSetRGBFillColor(context, info->tintColorR, info->tintColorG, info->tintColorB, 1); + CGContextSetRGBFillColor(context, info->tintColorR / 255.0f, info->tintColorG / 255.0f, info->tintColorB / 255.0f, 1); // move Y rendering to the top of the image CGContextTranslateCTM(context, 0.0f, (dim.height - shadowStrokePaddingY) ); CGContextScaleCTM(context, 1.0f, -1.0f); //NOTE: NSString draws in UIKit referential i.e. renders upside-down compared to CGBitmapContext referential