The PauseButton class can be used to add pause/resume functionality in your cocos2d games.
Key features:
- Custom pause code instead of CCDirector pause.
- Run actions and animations even while game paused.
- Slider In/Out on pause/resume.
- Transparent hue over game when paused.
- Extremely easy to use.
Generally the recommended pause solution for cocos2d games , i.e. CCDirector pause/resume api is only useful for demo purposes. It pauses everything in the game , so running actions and animations while the game is paused is not possible (which is often required in real games).
Our PauseButton class does not use CCDirector pause. Rather, it implements its own custom pause functionality. This can be used to run any actions or animations even when the game is paused.
Using these classes in your existing project is extremely easy, with no changes required to your existing flow of code.
The images used for pause button , slider and resume button are included but can be changed easily to suit your needs.
A lot of useful comments are included in the source code.
A Quick Start Guide and a Detailed Usage Guide is included.
Note: Art and code for moving ball used in demo video are not included.