cocos2d-html5在cocos2d-x里面打包编译
2014-02-20 17:15
399 查看
main.cpp打开USE_WIN32_CONSOLE输出
修改AppDelegate.cpp里面启动的js脚步
和屏幕大小
在ScriptingCore.cpp(D:\DevTool\cocos2d-x-2.2.2\cocos2d-x-2.2.2\scripting\javascript\bindings)
里面加个断点,方便看脚步出错问题
#include "main.h" #include "AppDelegate.h" #include "CCEGLView.h" #define USE_WIN32_CONSOLE USING_NS_CC; // uncomment below line, open debug console // #define USE_WIN32_CONSOLE int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); #ifdef USE_WIN32_CONSOLE AllocConsole(); freopen("CONIN$", "r", stdin); freopen("CONOUT$", "w", stdout); freopen("CONOUT$", "w", stderr); #endif
#include "main.h" #include "AppDelegate.h" #include "CCEGLView.h" #define USE_WIN32_CONSOLE USING_NS_CC; // uncomment below line, open debug console // #define USE_WIN32_CONSOLE int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); #ifdef USE_WIN32_CONSOLE AllocConsole(); freopen("CONIN$", "r", stdin); freopen("CONOUT$", "w", stdout); freopen("CONOUT$", "w", stderr); #endif
CCEGLView* eglView = CCEGLView::sharedOpenGLView(); eglView->setViewName("游戏名"); eglView->setFrameSize(960, 1440);
修改AppDelegate.cpp里面启动的js脚步
#if JSB_ENABLE_DEBUGGER ScriptingCore::getInstance()->enableDebugger(); ScriptingCore::getInstance()->runScript("main.debug.js"); #else ScriptingCore::getInstance()->runScript("游戏名-jsb.js"); #endif
和屏幕大小
// Set the design resolution CCEGLView::sharedOpenGLView()->setDesignResolutionSize(960, 640, kResolutionShowAll);
在ScriptingCore.cpp(D:\DevTool\cocos2d-x-2.2.2\cocos2d-x-2.2.2\scripting\javascript\bindings)
void ScriptingCore::reportError(JSContext *cx, const char *message, JSErrorReport *report) { js_log("%s:%u:%s\n", report->filename ? report->filename : "<no filename=\"filename\">", (unsigned int) report->lineno, message); };
里面加个断点,方便看脚步出错问题
相关文章推荐
- eclipse 打包编译 cocos2d-x 报错
- Cocos2d打包编译版本类型设定
- cocos2d-x 打包成so文件之后,假设出现错误,能够使用ndk-stack来查看里面的异常
- Cocos2D-X 项目发布到Android平台(三)编译打包Cocos2D-X项目生成apk安装包
- cocos2d-js 3.0 ios平台编译打包
- Cocos2d-x3.0 iOS 一键编译多个target并打包ipa。
- cocos2d-x 避免手打输入项目cpp文件到android.mk里面编译
- coocs2d-html5打包 (哎呀, cocos2d-html5全世界找内容都费劲那)
- cocos2d-x 避免手打输入项目cpp文件到android.mk里面编译
- iOS-cocos2d-X 游戏开发之七】整合Cocos2dX的Android项目到Xcode项目中,Xcode编写&编译代码,Android导入打包运行即可!
- cocos2d-x 避免手打输入项目cpp文件到android.mk里面编译
- Cocos2d-html5 通过apache ant编译成web应用以便部署到服务器
- cocos2d-html5的jsb模式下如何在编译时自动将js编译为jsc
- Cocos2D-HTML5 JSBinding Android编译指南
- Cocos2d-x3.9 在Windows平台下编译打包成APK
- cocos2d-html5将js编译为jsc
- Cocos2D-html5 发布游戏js编译为jsc
- Cocos2D-HTML5 MoonWarriors游戏Android编译指南(另附iOS编译指南和游戏源码)
- cocos2d-x 避免手打输入项目cpp文件到android.mk里面编译
- Mac COCOS2D-X用NDK编译安卓项目,打包成.so文件总结