Cocos2d-JS v3.0 alpha release: Feedbacks

@zhi_ye_tu_cao

The problem is that direct gl draw calls won’t make anything happen, because Cocos2d-x 3.0’s new renderer.
But we will bind GLNode and make this possible in beta version, by then, I will add these necessary functions and types in JSB

@pandamicro
OK, thank you very much!:smiley:

I am looking for the physical device resolution. I have seen this:
cc.EGLView.getInstance().getFrameSize()
but it is not available in Cocos2d-JS v3.0 JSB?

@rob2dx Thanks for the feed back

I will add this function in beta version.
And sorry for the inconvenient, for now, you can use cc.director.getWinSizeInPixels()

@pandamicro Thank you for your quick response!

When I set any DesignResolutionSize like cc.view.setDesignResolutionSize(1600, 900, cc.ResolutionPolicy.NO_BORDER); then it seems that all properties are set to 1600 x 900:

cc.director.getWinSize() = {"width":1600,"height":900}
cc.director.getWinSizeInPixels() = {"width":1600,"height":900}

So I don’t find a place where I can see the true pyhsical resolution of the container.

I wanted this for making a game with full resolution on any device, scaling sprites / UI according to true resolution and DPI (and using multiple layouts).

But then I realized I do not need to set a DesignResolutionSize at all. Then, I can see and use the true resolution of my Nexus 5 (minus Android on-screen buttons):

cc.director.getWinSize() = {"width":1794,"height":1080}
cc.director.getWinSizeInPixels() = {"width":1794,"height":1080}

On another note, cc.Device.getDPI() is 480 for a Nexus 5, but that is not actually true - it is the Android DPI setting for UI. The true physical DPI of the device is about 442. This can be checked with Java code:

DisplayMetrics metrics = getResources().getDisplayMetrics();

which returns xdpi=442.451, ydpi=443.345. So the question is if cc.Device.getDPI() could return the true DPI in the future.

Finally, it would be great to have Android fullscreen enabled by default, using the AppActivity.java template as described here: http://www.cocos2d-x.org/forums/6/topics/40642

Thanks for the amazing work. It blows my mind what you can do with Cocos2dx-JS in the browser and native.

@pandamicro

I have an issue about using RenderTexture after JSB to android jni codes. (I am using cocos2d-js 3.0 alpha1 version)

My process is: javascript -> JSB -> my native codes (for android, it’s jni c++ codes) -> create RenderTexture and try take screenshot -> save or export image data.

For iOS, it works fine. But every time I tried on android jni, the result always be black. So I guess maybe in android, RenderTexture doesn’t use the same OpenGL context that JSB use?

After checked change log of cocos2d-js 3.0 alpha2, it said " [JSB]OpenGL test is not functionnable in JSB. ". So my question is, is it the same issue as logged one? And when should I expect that this issue to be resolved?

Looking forward to your reply.

@ray58750034

We did have some issue on RenderTexture, but it’s not the reason for which we disabled OpenGL test, it was because we must upgrade our GLNode for the new renderer
Neither of these two issues have a high priority, but we will fix them before the 3.0 final release

@pandamicro
cocos2d-js beta 的 setInterval 无法正常使用,
开发环境:cocos2d-js beta, Xcode 5.1.1,iOS 6.1 模拟器

setInterval(function(){ cc.log('interval!!!!!'); }, 1000);

每隔1秒打印一句话,但是只打印了一次。纠结了我半天才找到解决方法:
jsb_cocos2d.js 里 setInterval 的定义里,将 cc.Director.getInstance().getScheduler().scheduleCallbackForTarget(target, target.fun, delay / 1000, cc.REPEAT_FOREVER, 0, false);
cc.REPEAT_FOREVER 改为 0xffffffff 就正常了

@zhi_ye_tu_cao

Thanks for reporting this issue, I will solve it asap.