歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux編程 >> Linux編程

Cocos2d-x在運行時候修改分辨率

下面是Cocos2d-x在運行時候修改分辨率:

 cocos2d::CCEGLView* eglView = cocos2d::CCEGLView::sharedOpenGLView();
 cocos2d::CCDirector* pDirector = cocos2d::CCDirector::sharedDirector();

 if ( eglView == NULL || pDirector == NULL )
 {
  return false;
 }

 eglView->setFrameSize(width, height);

 eglView->setDesignResolutionSize(width, height, kResolutionNoBorder);

 cocos2d::CCScene *pScene = HelloWorld::scene();
 pDirector->replaceScene(pScene);

剖析cocos2d-x之Action實現 http://www.linuxidc.com/Linux/2013-04/82436.htm

Ubuntu下cocos2d-x開發環境搭建及配置 http://www.linuxidc.com/Linux/2013-03/81876.htm

Cocos2d-x3.2實現虛擬搖桿多點觸摸 http://www.linuxidc.com/Linux/2014-09/106551.htm

Cocos2D-X 的詳細介紹:請點這裡
Cocos2D-X 的下載地址:請點這裡

Copyright © Linux教程網 All Rights Reserved