Rumah > Artikel > pangkalan data > cocos2dx添加背景颜色
--CCLayer就是一帧图层ccLayer = CCLayerColor:create(ccc4(0, 0, 255, 255))layerFarm:setVisible(true)layerFarm:addChild(ccLayer) ccc4是颜色RGBA式, 0, 0, 255, 255是纯蓝 255, 0, 0, 255 纯红 0, 255, 0, 255 纯绿 渐变背景 blue = ccc4(255, 0, 0, 2
--CCLayer就是一帧图层 ccLayer = CCLayerColor:create(ccc4(0, 0, 255, 255)) layerFarm:setVisible(true) layerFarm:addChild(ccLayer)
ccc4是颜色RGBA格式, 0, 0, 255, 255是纯蓝
255, 0, 0, 255 纯红
0, 255, 0, 255 纯绿
渐变背景
blue = ccc4(255, 0, 0, 255) green = ccc4(0, 255, 0, 255) gradiant = CCLayerGradient:create(blue, green) layerFarm:setVisible(true) layerFarm:addChild(gradiant)