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:
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 the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.