Given a definition of stars:
star1 = [CCSprite spriteWithFile: @ "x_unfilled.png"];
star1.position = ccp (30 + star1.contentSize.width, 240);
How design can make it in the touch screen appears (this picture).
I want to look at the complete program code of law.
Reply:
Reply:
In ccTouchBegan method is called to create the stars in the wizard approach just fine.
Reply:
First, even self.isTouchEnabled = YES;
Reply:
- (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;
}
No comments:
Post a Comment