Hello guys! I want change background color of scene.(I work with chipmunk physics)
LayerColor *_bgColor = LayerColor::create(Color4B(53,23,200,255));
this->addChild(_bgColor , -10);
2 Likes
If you’ve got a ui::Layout as a background panel already, it comes with a background color already too:
//example
parent_layout->setBackGroundColorType(cocos2d::ui::Layout::BackGroundColorType::GRADIENT);
parent_layout->setBackGroundColor(cocos2d::Color3B(61, 41, 72), cocos2d::Color3B(90, 65, 104));
parent_layout->setBackGroundColorOpacity(255/3);
parent_layout->setBackGroundColorVector(cocos2d::Vec2(0.5f, 0.0f));
Thank you very much! It’s working!
Thank you for reply!