I have very weird problem. When I run this code
CCTexture2DMutable * texture = [[CCTexture2DMutable alloc] initWithCGImage:image.CGImage resolutionType: kCCResolutioniPadRetinaDisplay];
CGFloat heightOfImage = image.size.height;
CGFloat heightOfTexture = texture.contentSize.height;
initWithCGImage is mathod that was inherit from CCTexture2D.
image <– UIImage
I get very weird result:
On iPad simululator (works fine):
heightOfImage = 1024
heightOfTexture = 1024
On iPad (retina) (not equal???):
heightOfImage = 1024
heightOfTexture = 512
Does any one know why? It drives me crazy.
If I change kCCResolutioniPadRetinaDisplay to kCCResolutioniPad the problem is the same.
Cocos use points for measurement, not pixels (anymore). That’s why the image size (in pixels) is different from the texture size (in points)