谁帮我编一个ios程序?
已知一个星星的定义:
star1 =[CCSprite spriteWithFile:@"x_unfilled.png"];
star1.position = ccp(30+star1.contentSize.width, 240);
怎么设计能让它在触摸屏幕后出现(这张图片)。
我要完整的程序来观察一下代码的规律.
ios 触摸屏 设计
[解决办法]
-(id)init{
self.isTouchEnabled=YES;
}
-(BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event{
CGPoint touchLocation = [self convertTouchToNodeSpace:touch];
star1 =[CCSprite spriteWithFile:@"x_unfilled.png"];
star1.position = ccp(30+star1.contentSize.width, 240);
CCLOG(@"%f,%f",touchLocation.x,touchLocation.y);
return YES;
}