标签:iphone
设置颜色
1:最简单的,[objSprite setColor:ccc3(r,g,b)];
2:简单的渐变,要使用CCFadeIn
[objSprite setColor:ccc3(r,g,b)];
[objSprite setPosition:ccp(w,h)];
[objSprite setOpacity:0.0f];
[objSprite runAction:[CCFadeIn actionWithDuration:2.0f]];
3.动态渐变的颜色
CCGradientLayer *gradientLay = [CCGradientLayer layerWithColor:ccc4(r,g,b,a) toColor:ccc4(r,g,b,a) withDirection:CCGradientDirectionT_B width:480 height:100]
标签:iphone
原文地址:http://126827.blog.51cto.com/116827/1587217