Edi*_*dig 4 iphone objective-c cocos2d-iphone joystick
我用cocos2d 2.0 BETA 2.0创建了一款游戏[最新版本].我需要在其他课程中添加一个操纵杆.所以我在第二节课中称之为"CCTouchDispatcher".但我不能这样打电话:
[[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:0 swallowsTouches:YES];
Run Code Online (Sandbox Code Playgroud)
所以我做了这个:
_tocuhDispatcher = [[CCTouchDispatcher alloc] init];
[_tocuhDispatcher addTargetedDelegate:self priority:0 swallowsTouches:YES];
Run Code Online (Sandbox Code Playgroud)
但仍然无法检测到触动.如果我启用HelloWorldLayer中的触摸,我可以移动我的对象,但操纵杆不起作用
我能做什么?
小智 10
CCDirector *director = [CCDirector sharedDirector];
[[director touchDispatcher] addTargetedDelegate:self priority:0 swallowsTouches:YES];
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2889 次 |
最近记录: |