URL->CCSprite
1.URL->UIImage
1 +(UIImage *) GetUIImageFromURL : (NSString *) url
2 {
3 return [UIImage imageWithData: [NSData dataWithContentsOfURL: [NSURL URLWithString: url]]];
4 }
2.UIImage->CCSprite
1 +(CCSprite *) convertImageToSprite:(UIImage *) image
2 {
3 CGImageRef cgimage = image.CGImage;
4 CCTexture2D *texture = [[CCTexture2D alloc] initWithCGImage:cgimage resolutionType:kCCResolutioniPhoneRetinaDisplay];
5 CCSprite *sprite = [CCSprite spriteWithTexture:texture];
6 [texture release];
7 return sprite;
8 }