11 cocos2d-x iOS 高低分辨率的坐标

  CCSprite *pSprite=CCSprite::create("Icon.png");
    CCSize size=CCDirector::sharedDirector()->getWinSize();
    pSprite->setPosition(ccp(size.width, size.height));
    this->addChild(pSprite);
    
    cout<<size.width<<","<<size.height<<endl;//480,320


如图:

11 cocos2d-x iOS 高低分辨率的坐标_第1张图片



默认分辨率: 480 * 320

Retina 模拟器:960 *640



你可能感兴趣的:(11 cocos2d-x iOS 高低分辨率的坐标)