2

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

Akarsh M
  • 1,629
  • 2
  • 24
  • 47

2 Answers2

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?

Mikael Olsson
  • 315
  • 3
  • 7
  • yeah , I am using nexus 7 (4.3) – Akarsh M Sep 14 '13 at 08:46
  • what is the solution for this ? – Akarsh M Sep 14 '13 at 08:47
  • 1
    It's hard to tell if there is any direct solution. As I said before 4.3 brought lots of bugs. http://www.cocos2d-x.org/forums/6/topics/35255 https://code.google.com/p/android/issues/detail?id=58385 Hopefully the authors of Cocos2d might come out with a fix soon, or Google them self will update 4.3. – Mikael Olsson Sep 14 '13 at 10:51
  • I found two game on google play which include the cocos2d android library. One game has same problem what I'm facing but the another one run perfectly on 4.3 – Akarsh M Sep 17 '13 at 05:48
  • So , I think May be there is another issue effected not this – Akarsh M Sep 17 '13 at 05:49
  • i see some nullpointer exception there. try running your game in debug mode with breakpoints. – Sandeep R Sep 17 '13 at 07:25
  • that issue comes in the library when I change the library API level 17 to 18. But what I found after is "the issue belongs to the high resolution." @sandeep – Akarsh M Sep 18 '13 at 05:24
  • please read the "Edit 2" , May be you'll get the point ? @sandeep – Akarsh M Sep 18 '13 at 05:34
1

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.