Using AWTextureFilter for blur and font shadows

By harnessing CCTexture2DMutable the class AWTextureFilter can be used to create some cool effects. These include Gaussian Blur , selective Gaussian Blur, and dynamically generated font shadows as shown in the following scene:

Using AWTextureFilter for blur and font shadows

Getting ready

Please refer to the project RecipeCollection01 for full working code of this recipe.

How to do it...

Execute the following code:

#import "CCTexture2DMutable.h" #import "AWTextureFilter.h" @implementation Ch1_UsingAWTextureFilter -(CCLayer*) runRecipe { CGSize winSize = [[CCDirector sharedDirector] winSize]; //Pixel Format RGBA8888 is required for blur effects [CCTexture2D ...

Get Cocos2d for iPhone 1 Game Development Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.