¡@

Home 

2014/10/15 ¤U¤È 10:04:57

iphone Programming Glossary: ccp

wrong position of tile map when i convert to retina display

http://stackoverflow.com/questions/12837104/wrong-position-of-tile-map-when-i-convert-to-retina-display

valueForKey @ y floatValue CC_CONTENT_SCALE_FACTOR MyGameScreen p MyGameScreen self.parentLayer p.gameActor.position ccp x y I used this function to get chord.. CGPoint getTileCoordForPosition CGPoint position int maxTileCol self.mapSize.height..

cocos2d: playing a video in the background of a menu

http://stackoverflow.com/questions/4454758/cocos2d-playing-a-video-in-the-background-of-a-menu

alloc initWithImage UIImage imageNamed @ logo.png UIView theView CCDirector sharedDirector openGLView logo setCenter ccp 240 80 moviePlayer.view addSubview logo self unscheduleAllSelectors but the movie still remains on top please guys any.. initWithImage UIImage imageNamed @ stupidLogo.png UIView theView CCDirector sharedDirector openGLView logo setCenter ccp 240 80 logo.transform CGAffineTransformMakeRotation 3.14 2 moviePlayer.view addSubview logo self unscheduleAllSelectors..

Create layer mask with custom-shaped hole

http://stackoverflow.com/questions/5721196/create-layer-mask-with-custom-shaped-hole

UIImage img UIImage imageNamed @ zebra.png CCSprite spr CCSprite spriteWithCGImage img.CGImage key @ img spr.position ccp winSize.width 2 winSize.width 2 self addSprite spr UIBezierPath path UIBezierPath bezierPathWithRect rectHole CAShapeLayer.. UIImage img UIImage imageNamed @ zebra.png CCSprite spr CCSprite spriteWithCGImage img.CGImage key @ img spr.position ccp winSize.width 2 winSize.width 2 self addSprite spr UIBezierPath path UIBezierPath bezierPathWithRect rectHole CAShapeLayer.. UIImage img UIImage imageNamed @ zebra.png CCSprite spr CCSprite spriteWithCGImage img.CGImage key @ img spr.position ccp winSize.width 2 winSize.width 2 self addSprite spr CGRect r spr boundingBox CGSize sz CGSizeMake r.size.width r.size.height..

Applying Zoom Effect In cocos2D gaming environment?

http://stackoverflow.com/questions/5919180/applying-zoom-effect-in-cocos2d-gaming-environment

any type of scrolling in your game you'll need to account for this. To do this set the anchorPoint of your layer to ccp 0.0f 0.0f and then calculate how much your layer has shifted and reposition it accordingly. void scale CGFloat newScale.. are doing a pinch zoom this should be the center of your pinch. Get the original center point. CGPoint oldCenterPoint ccp scaleCenter.x yourLayer.scale scaleCenter.y yourLayer.scale Set the scale. yourLayer.scale newScale Get the new center point... scaleCenter.y yourLayer.scale Set the scale. yourLayer.scale newScale Get the new center point. CGPoint newCenterPoint ccp scaleCenter.x yourLayer.scale scaleCenter.y yourLayer.scale Then calculate the delta. CGPoint centerPointDelta ccpSub oldCenterPoint..

Overlay Color Blend in OpenGL ES / iOS / Cocos2d

http://stackoverflow.com/questions/8771413/overlay-color-blend-in-opengl-es-ios-cocos2d

glBlendColor 0 255 0 255 glBlendFunc GL_ZERO GL_SRC_COLOR glColor4ub 255 0 255 255 glLineWidth 2 CGPoint vertices2 ccp 0 100 ccp 100 100 ccp 100 0 DrawingHelper drawPolygonWithPoints vertices2 points 3 closePolygon YES Draw helper is the logic.. 0 255 0 255 glBlendFunc GL_ZERO GL_SRC_COLOR glColor4ub 255 0 255 255 glLineWidth 2 CGPoint vertices2 ccp 0 100 ccp 100 100 ccp 100 0 DrawingHelper drawPolygonWithPoints vertices2 points 3 closePolygon YES Draw helper is the logic to draw.. 0 255 glBlendFunc GL_ZERO GL_SRC_COLOR glColor4ub 255 0 255 255 glLineWidth 2 CGPoint vertices2 ccp 0 100 ccp 100 100 ccp 100 0 DrawingHelper drawPolygonWithPoints vertices2 points 3 closePolygon YES Draw helper is the logic to draw the triangle...