当前位置:Gxlcms > mysql > cocos2dx添加背景颜色

cocos2dx添加背景颜色

时间:2021-07-01 10:21:17 帮助过:123人阅读

--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)	

人气教程排行