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:
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
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â.
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);
}
}
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â)
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:
Disable auto complete in comments
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:
Animations,
Particle effects,
Using physics in Cocos Creator,
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.
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.
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
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!
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.