【发布时间】:2012-08-30 01:05:28
【问题描述】:
-(void)ccTouchEnded:(UITouch *)touch withEvent:(UIEvent *)event
{
CGPoint location = [touch locationInView:[touch view]];
CGPoint convertedlocation = [[CCDirector sharedDirector] convertToGL:location];
bb=[CCMenuItemImage itemFromNormalImage:@"Aqua-ball.png" selectedImage:@"Aqua-ball.png" target:self selector:@selector(move:)];
menu1=[CCMenu menuWithItems:bb, nil];
//ignore this.....
}
-(void) move:(CGPoint) touch{
[character runAction:[CCMoveTo actionWithDuration:1 position:ccp(touch.x,touch.y)]];
}
我正在尝试制作 CCmenuitem 选择器:@selector(move:converted location),但它似乎无法接受参数,是否有一些这样做可以传递参数。
【问题讨论】:
标签: objective-c parameters cocos2d-iphone parameter-passing