How To Mask a Sprite with Cocos2D 2.0

In the previous tutorial, we showed you how to mask a sprite with Cocos2D 1.0. This method worked OK, but it had some drawbacks – it bloated our texture memory and had a performance hit for the drawing. But with Cocos2D 2.0 and OpenGL ES 2.0, we can do this much more efficiently by writing […] By Ray Wenderlich.

Leave a rating/review
Save for later
Share
You are currently viewing page 3 of 3 of this article. Click here to view the first page.

Where to Go From Here?

Here is a sample project with the code from the above tutorial.

That’s it for this tutorial series – hopefully you can start having a lot of fun with masking and Cocos2D – whichever version you choose to use!

If you want to learn more about Cocos2D 2.0, at the time of writing, there isn’t a lot of documentation on Cocos2D 2.0, so the best way to learn is by looking at the source and playing around with the new ShaderTest example.

If you want to learn more about shaders, I recommend Philip Rideout’s iPhone 3D Programming – it’s what I used to get started.

If you have any questions or comments, feel free to join the forum discussion below!

Contributors

Over 300 content creators. Join our team.