¡@

Home 

2014/10/15 ¤U¤È 10:05:33

iphone Programming Glossary: converttogl

How to get objects to react to touches in Cocos2D?

http://stackoverflow.com/questions/2437010/how-to-get-objects-to-react-to-touches-in-cocos2d

touch locationInView touch.view CGPoint location touch locationInView touch view location CCDirector sharedDirector convertToGL location if CGRectContainsPoint spRect location UIAlertView alert UIAlertView alloc initWithTitle @ Win message @ testing.. touch withEvent UIEvent event CGPoint touchPoint touch locationInView touch view touchPoint CCDirector sharedDirector convertToGL touchPoint NSLog @ ccTouch Moved is called void ccTouchEnded UITouch touch withEvent UIEvent event NSLog @ ccTouchEnded..

UIScrollView and Cocos2D

http://stackoverflow.com/questions/2457380/uiscrollview-and-cocos2d

touch view CGPoint point touch locationInView CCDirector sharedDirector openGLView point CCDirector sharedDirector convertToGL point return self convertToNodeSpace point CGPoint convertTouchToNodeSpaceAR UITouch touch cocos2d 1.0 rc bug when using.. touch view CGPoint point touch locationInView CCDirector sharedDirector openGLView point CCDirector sharedDirector convertToGL point return self convertToNodeSpaceAR point CCMenu.m CCMenuItem itemForTouch UITouch touch cocos2d 1.0 rc bug when using.. touchLocation touch locationInView CCDirector sharedDirector openGLView touchLocation CCDirector sharedDirector convertToGL touchLocation ... The key here is UITouch's locationInView method. The argument for this method should be the UIView that..

CCMoveTo of Cocos2D

http://stackoverflow.com/questions/5734072/ccmoveto-of-cocos2d

UIEvent event CGPoint location touch locationInView touch view CGPoint convertedLocation CCDirector sharedDirector convertToGL location spriteA stopAllActions spriteA runAction CCMoveTo actionWithDuration 1 position convertedLocation it can be moved.. UIEvent event CGPoint location touch locationInView touch view CGPoint convertedLocation CCDirector sharedDirector convertToGL location if abs convertedLocation.x abs convertedLocation.y convertedLocation ccp convertedLocation.x 0.0f else convertedLocation..

Rotate a Sprite on a bezier path with touch - Cocos2D/Box2D

http://stackoverflow.com/questions/7494795/rotate-a-sprite-on-a-bezier-path-with-touch-cocos2d-box2d

all the same basic rig on both the current touch and previous touch CGPoint touchingPoint CCDirector sharedDirector convertToGL location CGPoint firstTouchingPoint CCDirector sharedDirector convertToGL firstLocation CGPoint firstVector ccpSub firstTouchingPoint.. touchingPoint CCDirector sharedDirector convertToGL location CGPoint firstTouchingPoint CCDirector sharedDirector convertToGL firstLocation CGPoint firstVector ccpSub firstTouchingPoint _arrow.position CGFloat firstRotateAngle ccpToAngle firstVector..