Luke Hatcher’s excellent write-up on coloring sprites is a bit out of date for the latest version (v0.8.0) of Cocos2D.
Some very minor changes are necessary to get the example to work.
Originally, the tutorial sets both the position and color with the following two lines, or:
[redSprite setPosition:cpv(200, 160)];
[redSprite setRGB:255 :0 :0];
We need to change cpv
to ccp
and setRGB:r :g :b
to setColor:ccc3(r,g,b)
, or:
[redSprite setPosition:ccp(200, 160)];
[redSprite setColor:ccc3(255,0,0)];
That is it to get the example working.
0 thoughts on “API v0.8 Changes to Coloring Sprites”