Some common code used by other cocos2d-x extensions