使用Webstorm to develope cocos2dx js-binding/html 項目

来源:互联网 发布:网络侵权案例 编辑:程序博客网 时间:2024/06/05 10:45

Nowadays, cocos2dx gains its popularity among developers. It provides a fast, easy-to-maintain the platform for ios,iphone.windows,linux,w-phone and the like. Compared to traditional C++, javascript is not what  10 years ago now. 10 years ago, Javascript is only a second-level chicken in the world, but today, you can its shadow anywhere including Node.js, Express, Dojo, all of whose powerful magic comes from prototype. Yes, prototype, you know what I mean.


OK, let's get down to business. cc2dx js-binding in C++ is just a wrapper, so we do not need to care for too much. In order to use the intelligence tip, we need to download html5 source code, for they are using the same API. When I am writing this article, I use cc2dx 2.2.2.


Firstly, compie the whole project and in Debug.win32, you can see a directory named "TestJavascriptRes". This is a testjavascript project opened in visual studio. Next, unzip cc2dx-html5 to anywhere you like. We do not use them actually, but instead, configure it in westorm. Thus, open websotrm.



Select FILE -> Setting->Javascript->Libraries, in the right column click "ADD",add the cc2dx-html src.


OK. We done our configure. Let's hava a quick test.

Open the testjavasscript project in webstorm, open "tests-main.js"。Do some modifications. Replace the OnCloseButton function():

   onCloseCallback:function () {        cc.Director.getInstance().end();    },

Originally, this demo do not implement this functon. It just uses history.go(-1);

What if I want to add a frame animation? So easy, but I cannot remember the detail parameters.

See the tips.

Whoo-Oh-O!Amazing, fantastic, superb, excellent, outstanding, fabulous.

Cannot you see it.


0 0
原创粉丝点击