Announcing Cocos Creator public beta!

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

Is it coming to linux soon?

Sorry no plan for Linux now

Hi,

I just found some answers for my own questions maybe they could help someone:

  • What are the compatible browsers of cocoscreator, IE9+, IE10+, IE11+?
    A: From my test, it is IE10+
  • How to pass variables between scenes? Can you please give me some examples?
    A: Using singleton object
  • How to pass variables between scripts inside a scene? Can you please give me some examples?
    A: Using module.export and require

One remaining question if someone could help:
I have an atlas plist and png, and it’s shown as “cc.SpriteAtlas” in cocoscreator. I have a Node with Sprite and how can I change its spriteFrame to one in the atlas using script? I haven’t been able to do with neither new cc.Sprite(“frame_name.png”) nor new cc.SpriteFrame(“frame_name.png”)

Thanks a lot for the help.

Best,

1 Like

Awesome job guys. Recently tried full “Star Catcher” tutorial and I’m loving it. Thanks for making our life easier by giving a scene editor. Cocos Creator inspired me again for making a new game. Stay tuned.

It needs some improvements in auto complete list feature like:

  1. Disable auto complete in comments
  2. It doesn’t auto completes functions which are not written in script yet.

But I still need to check the size of “apk file” for empty project and I am hoping it to be less than 5 mb.
Can we have some more tutorials on:

  1. Animations,
  2. Particle effects,
  3. Using physics in Cocos Creator,
  4. and other awesome features.

Also please write documentation on github in English too.

Please make it as awesome as “BuildBox
I believe that Game Design should be simple, smooth and presentable. Frameworks should have some free animations, particle effects and other cool features to make awesome games as Ketchappstudio.

Once again thanks for making Cocos Creator awesome.

2 Likes

You will be able to use it in v1.0

cc.loader.loadRes('atlas.plist', function (error, atlas) {
    var spriteFrame = atlas.getSpriteFrame('frame_name.png');
});

We’d like to deprecate centralized cc.spriteFramecache

We will embed VSCode as the code editor in future version, so internal code editor won’t be improved anymore. Don’t worry, we have all you got today and even more in VSCode:

  • Autocompletion (with documentation)
  • Native debug

It’s bigger today, but we have plan to reduce the package size with a more compact version of Cocos2d-x.

And yes, we will bring more tutorials with v1.0, and we are working on English documentations too.

1 Like