0
我在遊戲中實現了偷偷摸摸/偷偷摸摸的輸入文件,並且製作了一個遊戲杆。我還增加了一個按鈕,一個CCMenuItem
:移動sneakyjoystick時不能點擊按鈕 - Cocos2D Objective-c
- (void)initJoystick {
SneakyJoystickSkinnedBase *joystickBase = [[SneakyJoystickSkinnedBase alloc] init];
joystickBase.backgroundSprite = [CCSprite spriteWithFile:@"base.png"];
joystickBase.thumbSprite = [CCSprite spriteWithFile:@"joystick.png"];
joystickBase.joystick = [[SneakyJoystick alloc] initWithRect:CGRectMake(0, 0, 128, 128)];
joystickBase.position = ccp(90, 90);
[self addChild:joystickBase z:1000];
leftJoystick = [joystickBase.joystick retain];
CCLabelTTF *shootLabel = [[CCLabelTTF alloc] initWithString:@"Shoot" fontName:@"helvetica" fontSize:32.0];
CCMenuItem *shootItem = [CCMenuItemLabel itemWithLabel:shootLabel target:self selector:@selector(shootTapped)];
shootItem.color = ccORANGE;
CCMenu *menu = [CCMenu menuWithItems:shootItem, nil];
menu.position = ccp(500, 25);
[self addChild:menu z:1000];
}
操縱桿工作正常,但是當我移動的按鈕,不承認任何印刷機。當我有CCMenuItems
而不是操縱桿時,另一個按鈕可以正常工作,但不能與操縱桿一起工作。那麼是否有人熟悉偷偷摸摸的文件,或者是否有人知道我如何能夠同時進行雙擊?
完美,謝謝 – user3139210