Home > Database > Mysql Tutorial > body text

cocos2dx添加背景颜色

WBOY
Release: 2016-06-07 15:19:25
Original
1896 people have browsed it

--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)	
Copy after login

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)	
Copy after login


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!