cocos2dx 3 Layer

创建一个全屏黑色背景

1:

在createscene中直接使用

auto layer = DrawPrimitivesTest::create();//这里创建一个全屏黑的的图层

scene->addChild(layer);


在init()中不需要做任何的处理就可以了;


2:如果需要改变其layer的颜色,则需要使用到layer的派生类layercolor

 //LayerColor* layer1 = LayerColor::create(Color4B(255,255,255,255));

 //this->addChild(layer1);




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章