--CCLayer就是一帧图层 ccLayer = CCLayerColor:create(ccc4(0,255,255)) layerFarm:setVisible(true) layerFarm:addChild(ccLayer)
ccc4是颜色RGBA格式, 0,255是纯蓝
255,255 纯红
0,255 纯绿
渐变背景
blue = ccc4(255,255) green = ccc4(0,255) gradiant = CCLayerGradient:create(blue,green) layerFarm:setVisible(true) layerFarm:addChild(gradiant)原文链接:https://www.f2er.com/cocos2dx/347037.html