Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Black Screen on Asus TF700 and NEXUS10 #65

Open
Trurl101 opened this issue Sep 30, 2012 · 10 comments
Open

Black Screen on Asus TF700 and NEXUS10 #65

Trurl101 opened this issue Sep 30, 2012 · 10 comments

Comments

@Trurl101
Copy link

Several users reported problems with my Apps on a Asus TF700. Update: AND Nexus10

The game starts, but the screen is black. But it seems the game is running. If they touch the black screen, where normally the start button would be, they see the replaceScene animation, but only on one half of the screen, the other half is black, after the replaceScene is finished the screen goes fully black again.

I don't have a TF700 to investigate this error and Asus refused my mail request to lend me a test device for a few days.

Has anyone an idea whats wrong with this device?

@Trurl101
Copy link
Author

This black screen problem seems to appear on every android device with high resolutions, like nexus10. Perhaps some parameters of cocos2d could be adjusted to work with such high resolutions?

@Trurl101
Copy link
Author

It seems that the screen only goes black if you start the app in portrait mode CCDirector.sharedDirector().setLandscape(false);, landscape mode works fine. This is true for my app (which is always in portrait mode) but also the cocos2d-test scripts. At the moment i don't know how to fix this. Anyone has an idea?

@tianzc
Copy link

tianzc commented Jan 16, 2013

this prolbem is appera in htc butterfly
when set Landscape(false), show black but is works
however,set Landscape(true),works fine

@ZhouWeikuan
Copy link
Owner

you should set orientation in androidManifest.xml but not in the code.

2013/1/16 tianzc notifications@github.com

this prolbem is appera in htc butterfly
when set Landscape(false), show black but is works
however,set Landscape(true),works fine


Reply to this email directly or view it on GitHubhttps://github.com//issues/65#issuecomment-12301127.

@tianzc
Copy link

tianzc commented Jan 16, 2013

i tried,but doesn't work
screen always show black

@Trurl101
Copy link
Author

    app.metric = 1;
    CGSize s = CCDirector.sharedDirector().winSize();
    if (s.height > 1280) {
        app.metric = s.height / 1280;
        s.height = s.height / app.metric;
        s.width = s.width / app.metric;
        CCDirector.sharedDirector().setScreenSize((int) s.width, (int) s.height);
    }

This works for me. But I don't know exactly why :)

It seems that cocos2d fails if the screen resolution is to high. But if I set the screen size manually with this function it works and I can use the whole device resolution anyway. The "setScreenSize" only seems to fix some internal things in cocos2d so that it works in all resolutions.

At the moment I don't have the time to dig deeper in this problem.

@tianzc
Copy link

tianzc commented Jan 16, 2013

According to what you said,it doesn't work
however, i modify class CCDirector like:

change

   public static final int kCCDirectorProjectionDefault = kCCDirectorProjection3D;

to
public static final int kCCDirectorProjectionDefault = kCCDirectorProjection2D;

problem is resolve,but i don't know why? Is it does not support3D?

@ZhouWeikuan
Copy link
Owner

It might be because texture max size is 1024 for height and width?
You can adjust it higher and try again.

2013/1/16 tianzc notifications@github.com

According to what you said,it doesn't work
however, i modify class CCDirector like:

change

public static final int kCCDirectorProjectionDefault = kCCDirectorProjection3D;

to
public static final int kCCDirectorProjectionDefault =
kCCDirectorProjection2D;

problem is resolve,but i don't know why? Is it does not support3D?


Reply to this email directly or view it on GitHubhttps://github.com//issues/65#issuecomment-12319445.

@tianzc
Copy link

tianzc commented Jan 17, 2013

it doesn't works,too

@pareshrathod
Copy link

Solution to above mentioned problem is:
In CCDirector's setProjection Method -
Change gluPerspective to 2000 instead of 1500
New Line will be like this -
GLU.gluPerspective(gl, 60, size.width/size.height, 0.5f, 2000.0f);

It works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants