demon9733
demon9733

Reputation: 854

Blocking touches in cocos2d

Is there a way to totally block touches in cocos2d (assume, file or something is loading and I don't want user to be able press anything) ?

Upvotes: 0

Views: 102

Answers (2)

peko
peko

Reputation: 11335

ignore all interactions:

 [[UIApplication sharedApplication] beginIgnoringInteractionEvents];

to unignore use:

[[UIApplication sharedApplication] endIgnoringInteractionEvents];

Upvotes: 1

Guru
Guru

Reputation: 22042

Manually you need to remove touches for menu and layer.

//Cocos2d 2.0

menu.touchEnabled = NO;   
layer.touchEnabled = NO;

//Cocos2d 1.0

menu.isTouchEnabled = NO;

Upvotes: 2

Related Questions