当前位置: 代码迷 >> Iphone >> 哪位高手帮小弟我编一个ios程序
  详细解决方案

哪位高手帮小弟我编一个ios程序

热度:26   发布时间:2016-04-25 05:56:39.0
谁帮我编一个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;
}
  相关解决方案