I’m new to cocos2d-x and c++, I’ve been diving in and so far really like the language and framework. I have a question regarding a layer deleting itself.
My game has several popup dialogues wich inherit from a Dialogue class (which inherits from CCLayer). The dialogue class has a
MenuItem in the top right that lets users close the dialogue. It would be neat (in both senses of the word) for the dialogue to be able to remove itself. I tried performing a function call that contains
delete this; however it appears the layer still has a pointer to it. What is the best solution to achieve this? I could keep the dialogue around and change the opacity but this seems a bit messy.