O'Reilly logo

Cocos2d for iPhone 1 Game Development Cookbook by Nathan Burba

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required