Has anyone run their game on Higher Resolution in Cocos2d-android?

我们两清 提交于 2019-12-21 21:08:04

问题


CCScene doesn't show anything on higher resolution ?

I am working on a project in which I'm using the cocos2d_android.jar and on the 4.3 version the screen goes blank and music/ccTouches/others things working fine.

Even after I change the jar file with the API level 18(4.3 version), Add into my project and there is no error in the import time and uses their classes but in the RunTimeError occurred like :

09-14 07:49:49.890: E/AndroidRuntime(1282): FATAL EXCEPTION: GLThread 102
09-14 07:49:49.890: E/AndroidRuntime(1282): java.lang.NullPointerException
09-14 07:49:49.890: E/AndroidRuntime(1282):     at      org.cocos2d.nodes.CCAtlasNode.calculateMaxItems(CCAtlasNode.java:86)
09-14 07:49:49.890: E/AndroidRuntime(1282):     at org.cocos2d.nodes.CCAtlasNode.<init>(CCAtlasNode.java:80)
09-14 07:49:49.890: E/AndroidRuntime(1282):     at org.cocos2d.nodes.CCLabelAtlas.<init>(CCLabelAtlas.java:41)
09-14 07:49:49.890: E/AndroidRuntime(1282):     at org.cocos2d.nodes.CCLabelAtlas.label(CCLabelAtlas.java:36)
09-14 07:49:49.890: E/AndroidRuntime(1282):     at   org.cocos2d.nodes.CCDirector.setGLDefaultValues(CCDirector.java:600)

EDIT 3:

These error comes when I change API level 18 in the Cocos2d-android main Library But What I found after this that the issue is not belongs to the API level 17/18 than I changed the library as previous AND ISSUE is relate to the HIGH RESOLUTION

I debugged the project but couldn't sort out this problem.

EDIT 1:

I checked two game which is made through cocos2d-android.jar and The same thing happened in one game like CCScene doesn't display anything and another one is working fine.

Edit 2 :

Nexus 7 resolution 1280*1920 and The height is acceptable after many changes in screensize what I found is 1735 is maximum height take by cocos2d-android. Is there any way to increase the size of height

What is the possibility to make it working. Somebody suggest the way


回答1:


With Android version 4.3 came some core changes and a couple of bugs. Google patched up 4.3 about a week after release. Are you testing on a Nexus device with the latest (and updated) 4.3 version?




回答2:


Solution : to this problem is

change gluPerspective to use 1662 instead of 1500 in CCDirector(setProjection method). This will work with resolutions up to 1920 galaxy s4 etc.



来源:https://stackoverflow.com/questions/18799648/has-anyone-run-their-game-on-higher-resolution-in-cocos2d-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!