¡@

Home 

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

iphone Programming Glossary: winsize

Cocos2D 2.0 screenshots on iOS 6

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

works fine. UIImage screenshotWithStartNode CCNode startNode CCDirector sharedDirector .nextDeltaTimeZero YES CGSize winSize CCDirector sharedDirector .winSize CCRenderTexture rtx CCRenderTexture renderTextureWithWidth winSize.width height winSize.height.. CCNode startNode CCDirector sharedDirector .nextDeltaTimeZero YES CGSize winSize CCDirector sharedDirector .winSize CCRenderTexture rtx CCRenderTexture renderTextureWithWidth winSize.width height winSize.height rtx begin startNode visit.. 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..

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

2.0. CCTMXObjectGroup objects tileMap objectGroupNamed NN_TILE_MAP_OBJECT_LAYER CGSize s CCDirector sharedDirector winSize NSMutableDictionary newtonPos objects objectNamed NN_NEWTON_POS if newtonPos float x newtonPos valueForKey @ x floatValue..

Admob banner integration in Cocos2d 2.0 / Admob banner in iphone games

http://stackoverflow.com/questions/14278166/admob-banner-integration-in-cocos2d-2-0-admob-banner-in-iphone-games

a generic request to load it with an ad. mBannerView loadRequest GADRequest request CGSize s CCDirector sharedDirector winSize CGRect frame mBannerView.frame off_x 0.0f on_x 0.0f switch mBannerType case kBanner_Portrait_Top off_y frame.size.height..

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

World fontName @ Times New Roman fontSize 64 ask director the the window size CGSize size CCDirector sharedDirector winSize position the label on the center of the screen label.position ccp size.width 2 size.height 2 add the label as a child to..

Random Sprite Destinations

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

addSpriteFramesWithFile @ metImg.plist target CCSprite spriteWithFile @ Frame2.png rect 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.. target CCSprite spriteWithFile @ Frame2.png rect 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.. 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..

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

setFullscreen YES animated YES moviePlayer.view setTransform CGAffineTransformMakeRotation float M_PI_2 CGSize winSize CCDirector sharedDirector winSize moviePlayer.view.frame CGRectMake 0 0 winSize.height winSize.width width and height are.. YES moviePlayer.view setTransform CGAffineTransformMakeRotation 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.. 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..

Create layer mask with custom-shaped hole

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

first. The sample code is ignoring the y axis differences between iPhone SDK and openGL. CAShapeLayer Example CGSize winSize CCDirector sharedDirector winSize UIImage img UIImage imageNamed @ zebra.png CCSprite spr CCSprite spriteWithCGImage img.CGImage.. the y axis differences between iPhone SDK and openGL. CAShapeLayer Example CGSize winSize CCDirector sharedDirector winSize UIImage img UIImage imageNamed @ zebra.png CCSprite spr CCSprite spriteWithCGImage img.CGImage key @ img spr.position ccp.. 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..

How can i apply lens effect to my UIImage?

http://stackoverflow.com/questions/6126515/how-can-i-apply-lens-effect-to-my-uiimage

to use it here is how you can easily apply a lens effect void aFunction const CGSize size CCDirector sharedDirector winSize Init and position your image CCSprite img CCSprite spriteWithFile @ images.png img.position ccp size.width 2.f size.height..