Cocos2d iphone setViewName已更改

Cocos2d iphone setViewName已更改,cocos2d-iphone,cocos2d-x,Cocos2d Iphone,Cocos2d X,在最新版本的cocos2d-x中,它似乎不再工作了。改成了什么 i、 e.在main.cpp中的HelloCpp项目中: // create the opengl view CCEGLView* eglView = CCEGLView::sharedOpenGLView(); // set the window name eglView->setViewName("Hello World"); eglView->setViewName和getViewName将从最新的cocos2d-x

在最新版本的cocos2d-x中,它似乎不再工作了。改成了什么

i、 e.在main.cpp中的HelloCpp项目中:

// create the opengl view
CCEGLView* eglView = CCEGLView::sharedOpenGLView();

// set the window name
eglView->setViewName("Hello World");
eglView->setViewName和getViewName将从最新的cocos2d-x中删除

我知道如果没有它,我们无法更改windows标题

但是如果需要,您可以编辑CCEGLView代码并尝试直接设置它

CCEGLView* eglView = CCEGLView::sharedOpenGLView();
strcpy(eglView->m_szViewName, "Test");
相应地操作*cocos2d::CCEGLViewProtocol::m_szViewName*受保护成员

这不是最好的方法。。。或者等到他们再加


试试看

如果您在Windows上,则可以使用窗口句柄(HWND)设置名称


希望这能有所帮助。

好吧,如果他们打算“再添加一次”,为什么他们会首先删除它?@Ben:我不确定他们是否会添加它……我说等他们再添加一次,因为我在查看cocos2d-x的bug时看到了请求……所以他们可能会,也可能不会
HWND handle = eglView->getHWnd();
SetWindowText(handle, "MY_GAME_TITLE");