Forums » C++ Framework » how to change background color with box2d tempalte »
| intangible intangible | how to change background color with box2d tempalte | ||||
|---|---|---|---|---|---|
|
Added by intangible intangible over 1 year ago
How to change background color with box2d template in cocos2d-x? I had tried not in cocos2d-x+box2d template , chapter 2 tutorial method is OK. Who can teach me,thank you~ |
||||
| Zhe Wang | RE: how to change background color with box2d tempalte | ||||
|
Added by Zhe Wang over 1 year ago
Have you changed the main layer's parent class from CCLayer to CCLayerColor, then initialized it with a different color? Enjoy Coding, Enjoy Life. |
||||
| intangible intangible | RE: how to change background color with box2d tempalte | ||||
|
Added by intangible intangible over 1 year ago
First, I appreciate you take the time to help me. but the background have not changed.The color is still black. it is cocos2d-x + box2d template. |
||||
| Tevfik Aloglu | RE: how to change background color with box2d tempalte | ||||
|
Added by Tevfik Aloglu 4 months ago
I have exactly same problem.. I use cocos2d-x ; 1. In HelloWorldScene.h 2. In HelloWorldScene.cpp it doesnt change anything i tried with different opacity and different rgb values? |
||||
| Lance Gray | RE: how to change background color with box2d tempalte | ||||
|
Added by Lance Gray 4 months ago
You have to call this -> setColor( ccc4( R, G, B, O ) ); on the init() method. Check out my blog: sudo make_me_a_game |
||||
| Tevfik Aloglu | RE: how to change background color with box2d tempalte | ||||
|
Added by Tevfik Aloglu 4 months ago
Lance Gray wrote:
Thanks for answer but first of all setColor takes a different parameter. Second, when i try this->getColor(), i see that R,G,B is changed but just screen color did not |
(1-5/5)