Home  >  Article  >  Database  >  cocos2dx添加背景颜色

cocos2dx添加背景颜色

WBOY
WBOYOriginal
2016-06-07 15:19:251896browse

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


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn