cocos2d-x颜色层 CCLayerColor

//背景颜色
	if (!CCLayerColor::initWithColor(ccc4f(255, 255, 255, 255))) {
		return false;
	}
	m_bIsRelativeAnchorPoint = false;	//???
	CCLayerColor::initWithColor(ccc4(0, 0, 255, 255));


	//创建	后面一个数就一直是 255(255是不透明……) for cocos2d-x2.0
	ccColor4B color = ccc4(238, 118, 0, 255);
	CCLayerColor *color_layer = CCLayerColor::create(color);
	CCSize c_size(_scr_size.width, 150);	//宽和高
	color_layer->setPosition(ccp(0, 0));	//设置位置,注意,CCLayerColor 的贴图点是左下角,而且还改不了……
	color_layer->setContentSize(c_size);	//设置这块区域的大小
	this->addChild(color_layer, 0);

你可能感兴趣的:(color,cocos2d-x,CCLayerColor,CCLayer)