Creativity apps have been growing in popularity and the Cocos2D framework has already been used in a number drawing apps and coloring games. Some time ago I mentioned an excellent color picker implementation created with Cocos2D designed specifically for touch screens.
Something that nearly any drawing app or coloring game will need is the ability to floodfill an image with a specified color.
Today I came across a class that makes this very easy you simply initialize the provided CCSpriteFloodFill class with an image, and provide the fillFromPoint method a screen location and color, and the image will automatically be flood filled from that point.
The example is from Ignacio Inglese and can be found on Github here. You can read the original thread with more details on the example and algorithm in the Cocos2D forum here.
Very useful if you want to put together any kind of drawing or coloring app.
Added to the Cocos2D tutorial and example page.
©2012 iPhone, iOS 5, iPad SDK Development Tutorial and Programming Tips. All Rights Reserved.
.






