iphone - Render texture using Cocos 2d and Box 2d -
i have cocos2d , box2d application. have image bubble.png. want draw chain of bubbles when user swipes screen.
can tell me how ?
thanks
- (void)cctouchesmoved:(nsset *)touches withevent:(uievent *)event{ { //add new body/atlas sprite @ touched location for( uitouch *touch in touches ) { cgpoint location = [touch locationinview: [touch view]]; location = [[ccdirector shareddirector] converttogl: location]; b2vec2 locationworld = b2vec2(location.x/ptm_ratio, location.y/ptm_ratio); ccsprite *mist=[ccsprite spritewithfile:@"bubble.png"]; mist.position=ccp(location.x,location.y); [self addchild:mist]; } }
Comments
Post a Comment