Breaking News
Home / iOS / iOS Snippets / How to do get handle to various shared Cocos2D objects?

How to do get handle to various shared Cocos2D objects?

Answer

The Cocos2D framework  provides a lot of singleton objects that act as delegates/managers for basic objects like Textures, Sprites, Audio etc.

The  following methods provides the handler to these high level Cocos2D framework:<!>CCActionManager* sharedManager = [CCActionManager sharedManager];

CCDirector* sharedDirector = [CCDirector sharedDirector];

CCSpriteFrameCache* sharedCache = [CCSpriteFrameCache sharedSpriteFrameCache];

CCTextureCache* sharedTexCache = [CCTextureCache sharedTextureCache];

CCTouchDispatcher* sharedDispatcher = [CCTouchDispatcher sharedDispatcher];

CDAudioManager* sharedManager = [CDAudioManager sharedManager];

SimpleAudioEngine* sharedEngine = [SimpleAudioEngine sharedEngine];

[pb_builder]

Check Also

EKCalendar – That account does not allow calendars to be added or removed

Usecase When I am trying to create a new Calendar programmatically using the EventKit API …

Advertisment ad adsense adlogger