Announcing Cocos Creator public beta!

HI @pandamicro,

Sorry if it is not right place to ask my question.

I have downloaded COCOS CREATOR and start with demo app but when i work with offline mode, it create issues as below:

{ [Error: getaddrinfo ENOTFOUND fbupdater.avosapps.com fbupdater.avosapps.com:80] code: ‘ENOTFOUND’, errno: ‘ENOTFOUND’, syscall: ‘getaddrinfo’, hostname: ‘fbupdater.avosapps.com’, host: ‘fbupdater.avosapps.com’, port: 80 } at ClientRequest. (/Applications/CocosCreator.app/Contents/Resources/app.asar/share/hot-updates.js:1:1902) at emitOne (events.js:77:13) at ClientRequest.emit (events.js:169:7) at Socket.socketErrorListener (_http_client.js:259:9) at emitOne (events.js:77:13) at Socket.emit (events.js:169:7) at connectErrorNT (net.js:993:8) at doNTCallback2 (node.js:441:9) at process._tickCallback (node.js:355:17)

Can you please help me solve that issue? Is there any issue in setup Cocos Creator?

Thanks
Kamal

In offline mode, it’s normal to see these messages, the first one is the communication with our login server, the second one is the hot update request to see whether a new version is out.

Did they block any usage in Creator ? If not, you can just ignore them

Hi!

I’m using Cocos Creator since a few days, and while I still have a lot to discover, I do enjoy using it more and more day after day: great job guys!!

I have a bug report and a couple of suggestions:

Bug Report (I’m using the Mac version):

  • very often, when using the build in JavaScript editor (the one opening a standalone window), it hangs after I start making some changes in the source code
    (the autocompletion did not seemed to start so I don’t think it is autocompletion related)
    (it maybe happen more often when I create variables outside cc.Class({}); block, like: var Utils = require(‘Utils’); )

It’s not a big deal as I can just kill the window related to the JavaScript Editor (which was using ~100% CPU) without exiting the project, but I wanted to mention it.

Suggestions (build related) - it would be great if it was possible to:

  • being able to start the build process from the command line
  • automatically start a pre-build script
  • automatically start a post-build script
  • specify the real build directory name, without having a platform name directory (native, web-mobile etc) added to it

Is there any git repo where is available the latest version of Cocos Creator?

Thanks.


Daniel

1 Like

Will the new version(0.8 , 0.9, 1.0, 2.0) compatible with old projects(0.71)?

Hi, I’m new at Cocos2d. I’m really interested in Cocos Creator but I’m a bit confused about that.

My most important question is: is it possible to create native games with Cocos Creator or is it only for web browser based games?

Thanks

It is for JavaScript games, currently. C++ is coming. These JavaScript games can run on iOS, Desktops, Android, or a browser.

Please add EXACT_FIT resolution policy for canvas in Cocos Creator also :smile:

Thank you for your suggestions, the first one is already supported in the dev version. We will discuss how to support pre & post build scripts, I also think it’s a great idea personally. The last one, you mean unified build directory for web & native ?

Yes, your project will be compatible across the versions, and for major version update, we might introduce some difference, but will also provide a upgrade tool or something.

As for now, we are in public beta, and we haven’t reach 1.0 yet, the APIs may still change, it is possible, we will give clear informations about the changes to help you fix issues caused by API change. But in any way, your project will be compatible with 1.0 and future versions.

You can still do the following manually.

cc.view.setDesignResolutionSize(960, 640, cc.ResolutionPolicy.EXACT_FIT)

I mean that the directory specified should be the one really used to put the generated files, not a directory name in which there will be an other subdirectory (like ‘native’, ‘web-mobile’ etc).

PS: How can I start the build process from the command line? I tried /Applications/CocosCreator.app/Contents/MacOS/CocosCreator --help but it just started an other session of Cocos Creator


Daniel

Oh, I see, feed back get, we will talk about it

You need to use cocos console, normally if you can successfully build native package via Creator, it means you already got one. Just do the following in your native build path:

cocos run -p android|ios|etc

Detailed doc can be found: http://www.cocos2d-x.org/wiki/Cocos2d-console

“C++ is coming”
Cool!

When Cocos Creator build the project it will compress and replace the original main.js file which make it unable to put in new code. Even I paste the new code in main.js after building process completed, it will not update the resolution policy also.

In the build\jsb\src\jsb_polyfill.js file, line 3986, there is no EXACT_FIT resolution policy. I guess that is the reason it is not supported? Sorry, I am newbie in cocos2dx :stuck_out_tongue_closed_eyes:

applySettings: function() {
                var ResolutionPolicy = cc.ResolutionPolicy;
                var policy;
                if (this.fitHeight && this.fitWidth) {
                    policy = ResolutionPolicy.SHOW_ALL;
                } else {
                    if (!this.fitHeight && !this.fitWidth) {
                        policy = ResolutionPolicy.NO_BORDER;
                    } else {
                        if (this.fitWidth) {
                            policy = ResolutionPolicy.FIXED_WIDTH;
                        } else {
                            policy = ResolutionPolicy.FIXED_HEIGHT;
                        }
                    }
                }
                var designRes = this._designResolution;
                if (false) {
                    cc.engine.setDesignResolutionSize(designRes.width, designRes.height);
                } else {
                    cc.view.setDesignResolutionSize(designRes.width, designRes.height, policy);
                }
            }

@pandamicro when I try to connect an android device to Cocos Creator using url for local network, in the “connected device counter” appears like connected but in the device only shows a screen of “Powered by Cocos Creator”.

you have to go file/build build it for android then you can run on your phone use play on device

You can put it into your project script, it should work fine if it’s executed after cc.game.onStart.

Hi pandamicro. Nope. It is not working. Cocos Creator will replace every code that I have changed when I click build button and it will run those in jsb_polyfill.js. The only solution is temporary by hard-coded into \jsb\src\jsb_polyfill.js file after build.

You can see the following code that I have added to force it change resolution policy to EXACT_FIT because there is no logic to assign this value anywhere.

Maybe need to fix this in Cocos Creator editor source code?

policy = ResolutionPolicy.EXACT_FIT;

Original Code in \jsb\src\jsb_polyfill.js file

applySettings: function() {
                var ResolutionPolicy = cc.ResolutionPolicy;
                var policy;
                if (this.fitHeight && this.fitWidth) {
                    policy = ResolutionPolicy.SHOW_ALL;
                } else {
                    if (!this.fitHeight && !this.fitWidth) {
                        policy = ResolutionPolicy.NO_BORDER;
                    } else {
                        if (this.fitWidth) {
                            policy = ResolutionPolicy.FIXED_WIDTH;
                        } else {
                            policy = ResolutionPolicy.FIXED_HEIGHT;
                        }
                    }
                }
                var designRes = this._designResolution;
                if (false) {
                    cc.engine.setDesignResolutionSize(designRes.width, designRes.height);
                } else {
                    cc.view.setDesignResolutionSize(designRes.width, designRes.height, policy);
                }
            }

Modified Code in \jsb\src\jsb_polyfill.js file

applySettings: function() {
                var ResolutionPolicy = cc.ResolutionPolicy;
                var policy;
                if (this.fitHeight && this.fitWidth) {
                    policy = ResolutionPolicy.SHOW_ALL;
                } else {
                    if (!this.fitHeight && !this.fitWidth) {
                        policy = ResolutionPolicy.NO_BORDER;
                    } else {
                        if (this.fitWidth) {
                            policy = ResolutionPolicy.FIXED_WIDTH;
                        } else {
                            policy = ResolutionPolicy.FIXED_HEIGHT;
                        }
                    }
                }

		policy = ResolutionPolicy.EXACT_FIT; // My added code. It works!

                var designRes = this._designResolution;
                if (false) {
                    cc.engine.setDesignResolutionSize(designRes.width, designRes.height);
                } else {
                    cc.view.setDesignResolutionSize(designRes.width, designRes.height, policy);
                }
            }

Do not modify jsb_polyfill.js itself

I mean you can add the code into a global component which could be attached to Canvas node, just put resolution policy code into its onLoad function.

Thanks. It is working now :smile:

1 Like