diff --git a/cocos2dx/CCDirector.cpp b/cocos2dx/CCDirector.cpp index c9d112cc71..80c9a6f60b 100644 --- a/cocos2dx/CCDirector.cpp +++ b/cocos2dx/CCDirector.cpp @@ -775,20 +775,21 @@ void CCDirector::createStatsLabel() m_pDrawsLabel = new CCLabelAtlas(); m_pDrawsLabel->initWithString("000", "fps_images.png", 12, 32, '.'); */ - m_pFPSLabel = CCLabelTTF::create("00.0", "Arial", 24); + int fontSize = (int)(m_obWinSizeInPoints.height / 320.0f * 24); + m_pFPSLabel = CCLabelTTF::create("00.0", "Arial", fontSize); m_pFPSLabel->retain(); - m_pSPFLabel = CCLabelTTF::create("0.000", "Arial", 24); + m_pSPFLabel = CCLabelTTF::create("0.000", "Arial", fontSize); m_pSPFLabel->retain(); - m_pDrawsLabel = CCLabelTTF::create("000", "Arial", 24); + m_pDrawsLabel = CCLabelTTF::create("000", "Arial", fontSize); m_pDrawsLabel->retain(); //CCTexture2D::setDefaultAlphaPixelFormat(currentFormat); CCSize contentSize = m_pDrawsLabel->getContentSize(); - m_pDrawsLabel->setPosition(ccpAdd(ccp(contentSize.width/2, contentSize.height/2 + 40), CC_DIRECTOR_STATS_POSITION)); + m_pDrawsLabel->setPosition(ccpAdd(ccp(contentSize.width/2, contentSize.height*5/2), CC_DIRECTOR_STATS_POSITION)); contentSize = m_pSPFLabel->getContentSize(); - m_pSPFLabel->setPosition(ccpAdd(ccp(contentSize.width/2, contentSize.height/2 + 20), CC_DIRECTOR_STATS_POSITION)); + m_pSPFLabel->setPosition(ccpAdd(ccp(contentSize.width/2, contentSize.height*3/2), CC_DIRECTOR_STATS_POSITION)); contentSize = m_pFPSLabel->getContentSize(); m_pFPSLabel->setPosition(ccpAdd(ccp(contentSize.width/2, contentSize.height/2), CC_DIRECTOR_STATS_POSITION)); } diff --git a/cocos2dx/platform/CCEGLViewProtocol.cpp b/cocos2dx/platform/CCEGLViewProtocol.cpp index 741c5be938..d1e8d90772 100644 --- a/cocos2dx/platform/CCEGLViewProtocol.cpp +++ b/cocos2dx/platform/CCEGLViewProtocol.cpp @@ -87,12 +87,10 @@ void CCEGLViewProtocol::setDesignResolutionSize(float width, float height, Resol m_eResolutionPolicy = resolutionPolicy; - //setViewPortInPoints(0, 0,m_obScreenSize.width, m_obScreenSize.height); - - // reset director's member variables to fit visible rect - CCDirector::sharedDirector()->createStatsLabel(); + // reset director's member variables to fit visible rect CCDirector::sharedDirector()->m_obWinSizeInPoints = getSize(); CCDirector::sharedDirector()->m_obWinSizeInPixels = CCSizeMake(m_obDesignResolutionSize.width*CC_CONTENT_SCALE_FACTOR(), m_obDesignResolutionSize.height*CC_CONTENT_SCALE_FACTOR()); + CCDirector::sharedDirector()->createStatsLabel(); CCDirector::sharedDirector()->setGLDefaultValues(); }