Adding CCLayer over another CCLayer in cocos2d-x

448 views Asked by At

I have a main CCLayer which is covering the start up screen, and then I added one more CCLayer and set it's width and height to my requirement. Target class of added layer is another class different from main CCLayer. So I want when user clicks on the the adde CClayer it should call its MotionBegin method. But when I try to run the program its give me error. I am working on COCOS2D-X in C++, and using COCO Builder to add CCLayer over the .ccbi files. Can anybody tell me how can I add the new CCLayer over another layer? MY program with main CCLayer works fine but I have to add another layer.

2

There are 2 answers

0
Seagull On BEST ANSWER

In last cocos2d-x versions it worked ok.

0
Zubair On

Till cocos2d-x version 2.1.2 you can't add a CCLayer over another if both of the CCLayers have different custom classes. May be there is support for this in the latest edition.