What is the best way to get a popup in Cocos2D?

I am developing an iOS game using Cocos2D. I would like to show a popup, something like a UIAlertView, but completely custom. What is the best way to achieve this?

Thanks a lot! Benza

+4
source share
2 answers

I would suggest using a layer for this and pausing the scene. Here are some forum posts from Cocos2d that are slightly different from this:

http://www.cocos2d-iphone.org/forum/topic/6511

http://www.cocos2d-iphone.org/forum/topic/1954

+4
source

Unfortunately, pausing a scene means that you also pause everything you have in the popup. Maybe this is not your business, but I pretty often scroll through the lists in my pop-ups. If I stop the scene, it will not work. I added the CCNode method, which goes through all the children and stops their activity, not pauses the scene. If you open the popup as a child of your scene, first turn off all the children in the scene and open the popup. This means that you can still do whatever you want in the pop-up window, and everything else is paused or does not respond to touch [like a menu].

+1
source

All Articles