¡@

Home 

2014/10/15 ¤U¤È 10:15:58

iphone Programming Glossary: winsize.width

Cocos2D 2.0 screenshots on iOS 6

http://stackoverflow.com/questions/12413460/cocos2d-2-0-screenshots-on-ios-6

YES CGSize winSize CCDirector sharedDirector .winSize CCRenderTexture rtx CCRenderTexture renderTextureWithWidth winSize.width height winSize.height rtx begin startNode visit rtx end return rtx getUIImage You can call it like this CCScene scene..

Random Sprite Destinations

http://stackoverflow.com/questions/3817637/random-sprite-destinations

CGRectMake 0 0 60 120 CGSize winSize CCDirector sharedDirector winSize int minY target.contentSize.height 2 int maxY winSize.width 1.5 target.contentSize.height 2 int rangeY maxY minY int actualY arc4random rangeY minY target.position ccp actualY target.contentSize.height.. CGRectMake 0 0 30 60 CGSize winSize CCDirector sharedDirector winSize int minY target.contentSize.width 2 int maxY winSize.width target.contentSize.width 2 int rangeY maxY minY int actualY arc4random rangeY minY target.position ccp winSize.width target.contentSize.width.. winSize.width target.contentSize.width 2 int rangeY maxY minY int actualY arc4random rangeY minY target.position ccp winSize.width target.contentSize.width 2 actualY self addChild target int minDuration 2.0 int maxDuration 4.0 int rangeDuration maxDuration..

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

float M_PI_2 CGSize winSize CCDirector sharedDirector winSize moviePlayer.view.frame CGRectMake 0 0 winSize.height winSize.width width and height are swapped after rotation CCDirector sharedDirector openGLView addSubview moviePlayer.view moviePlayer..

Create layer mask with custom-shaped hole

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

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 maskLayer CAShapeLayer.. 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 maskLayer CAShapeLayer layer.. 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 maskLayer CAShapeLayer..