Announcing Cocos Creator public beta!

Announcing Cocos Creator public beta!
0.0 0

#83

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


Building Cocos Creator project from command line
#84

“C++ is coming”
Cool!


#85

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);
                }
            }

#86

@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”.


#87

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


#88

#89

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


#90

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);
                }
            }

#91

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.


#92

Thanks. It is working now :smile:


#93

Is it coming to linux soon?


#94

Sorry no plan for Linux now


#95

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,


#96

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.


#97

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.


#98

That’s cool, this is my working code for the moment

cc.loader.loadAliases("res/raw-assets/images/atlases/a.plist", function() {
            cc.spriteFrameCache.addSpriteFrames("res/raw-assets/images/atlases/a.plist", "res/raw-assets/images/atlases/a.png");
        });

Also currently my .plist files are not exported in build, so I have to copy them manually, is that a bug or intended so?

This is also great, the internal editor is slow sometimes.


#99

That’s because atlas plist file is not a raw asset, it will be imported and permit you to use the new API I mentioned, if you are interested, I can give you a 1.0 rc version to test it out.

Others can also request the 1.0 rc version for testing, just send me a PM


#100

This is awesome! I would like to have a physics body editor parser for custom physics bodies. I loved this tool and I don’t like to have to work with JavaScript!


#101

Same issue in release ver 1.0.1.

properties: {
    label: {
        default: null,
        type: cc.Label
    },
    text: 'Some changed text'
},

onLoad: function () {
    this.label.string = this.text;
},

Disabling or cleaning browser cache definitely doesn’t help.
The only way how i can change the text is by commenting\removing the “text: “…”” line, reloading, uncommenting the line, reloading again. Weird.