发布时间:2016-03-22责任编辑:朱明 浏览:1612
软硬件需求:
1、操作系统是windows8及以上版本
2、CUP64位且支持虚拟化
步骤:
1、安装windows8操作系统
2、安装VS2013
cocos2d-x2.2.3及以上版本
cocos2d-x3.0及以上版本
创建工程,进入工程目录下,proj.wp8-xaml文件夹。打开.sln,编译运行。
进入cocos2dplatformwp8目录下,CCGLView.cpp
GLView::GLView()
: _frameZoomFactor(1.0f)
, _supportTouch(true)
, _isRetina(false)
, m_lastPointValid(false)
, m_running(false)
, m_initialized(false)
, m_windowClosed(false)
, m_windowVisible(true)
, m_width(0)
, m_height(0)
, m_eglDisplay(nullptr)
, m_eglContext(nullptr)
, m_eglSurface(nullptr)
, m_delegate(nullptr)
, m_messageBoxDelegate(nullptr)
, m_orientation(DisplayOrientations::Landscape)
DisplayOrientations::Landscape此处设置横竖屏。
通常是因为找不到texturecache中的资源。Debug模式下输出错误信息,查看找不到的资源。在
void AppDelegate::applicationWillEnterForeground() {
Director::getInstance()->startAnimation();
// if you use SimpleAudioEngine, it must resume here
CocosDenshion::SimpleAudioEngine::getInstance()->resumeBackgroundMusic();
}
中将找不到的资源重新加载。
在mainpage.cs中找到OnBackKeyPress函数。
重写该函数:
protected override void OnBackKeyPress(CancelEventArgs e)
{
e.Cancel = true;
if (MessageBox.Show("是否退出游戏","退出",MessageBoxButton.OKCancel) == MessageBoxResult.OK)
{
m_d3dInterop.OnBackKeyPress();
}
}
喵玩工作室