Get Updates By E-mail 

Article Written By:
Johann Dowa

Tutorial: Masking Sprites In Cocos2D With CCRenderTexture

  •  
  •  
  •  
  •  
  •  

Sprite masking can be used to create some very cool image effects.  Things like adding a ragged border around images, hiding body parts of an image can be done easily with sprite masking.

I’ve found a tutorial explaining how to mask sprites within Cocos2D 1.0.  The tutorial explains how to apply a mask to a sprite using CCRenderTexture within Cocos2D.  What’s cool about this is that it is very easy way to add some style and interesting effects to your sprites.

The tutorial is from Ray Wenderlich creator of the Space Game Starter Kit and co-author of the Learning Cocos2D book, and can be found here:
How To Mask A Sprite With Cocos2D 1.0

Ray has also written a tutorial on sprite masking with Cocos2D 2.0.  This can be done much more efficiently in Cocos2D 2.0 as it uses OpenGL ES 2.0 so the entire process can be done using shaders.  Keep in mind Cocos2D 2.0 is in an Alpha state right now, but provides some great info if you want to learn about using custom shaders.

You can find the tutorial here:
How To Mask A Sprite With Cocos2D 2.0

Some essential material if you are developing with Cocos2D.  I find the OpenGL ES 2.0 stuff to be quite challenging to understand, but there is definitely a big performance improvement.


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments