Helper functions and extensions for cocos2d-x