0
我使用Cocos2d 2.0和AWTextureFilter。我需要模糊紋理。這裏是我的代碼:Cocos2d 2.1 AWTextureFilter只模糊紋理的一部分
//Create mutable texture
CCTexture2DMutable *texture = [[CCTexture2DMutable alloc] initWithCGImage:[UIImage imageNamed:@"image.png"].CGImage resolutionType:kCCResolutionUnknown];
//Apply blur to the mutable texture
[AWTextureFilter blur:texture radius:10 rect:CGRectMake(0, 0, texture.contentSize.width, texture.contentSize.height)];
//Create sprites to show the textures
CCSprite *sprite = [CCSprite spriteWithTexture:texture];
sprite.position = ccp(winSize.width/2, winSize.height/2);
[layer addChild:sprite];
但結果我得到小妖精模糊(截圖)中的一部分: http://img62.imageshack.us/img62/182/blura.png
爲什麼會這樣?
非常感謝,Steffen!有用。 – joycoma 2013-04-21 22:34:36