JS API (app design)

I have several questions about Cocos2D-X JSB API.
I want to know if:
* We can set the design resolution size, to autoscale to all screens
* We can put retina images into respective folders to fit screen density
* We can localize strings with a native Cocos2D-X JS component
* We can read a dictionary, or a regular text file

Thanks

As I know,

  1. game render is controlled by ccoos2dx, not javascript, so design resolution size can be set somewhere in cocos2dx;
  2. read a dictionary or a file is ok. You can read them in C++ and then bind a function to send whatever you have got to JavaScript, so you can get these file content in JS;

as for 2, I think it is the same with 1: game render is controlled by cocos2dx, including reading image or other resource files.

We can set the design resolution size, to autoscale to all screens

You could do it at Appdelegate.cpp. Please look inside the JSBinding demo projects( CocosDragonJS, MoonWarriors ) in the latest release.

We can put retina images into respective folders to fit screen density

The same as 1), just using CCFileUtils::setResourceDirectory together with CCDirector::setContentScaleFactor and CCEGLView::setDesignResolutionSize. For more details, you should refer to HelloCpp.

We can localize strings with a native Cocos2D-X JS component

You could save all language string to different xml, but sorry for that the xml parse isn’t supported now.

We can read a dictionary, or a regular text file

The same as 3), not supported now.

Ok, so multi-resolution handling is made from C**.
Actually I read Dictionaries from C** too, I use them to localize my strings.
I just need to create bindings :slight_smile: .
Thanks.