Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9169419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:52:36+00:00 2026-06-17T15:52:36+00:00

I am writing a game for Android using AndEngine GLES 2 . Everything was

  • 0

I am writing a game for Android using AndEngine GLES 2. Everything was working properly – I had a background image, there were sprites moving around and even some music – until recently I tried something new (I wanted to be able to switch between two different scenes) when the display turned black.

I could still execute the game and there were no error shown. All log entries I made during the game were shown, even the music was playing so I knew the game was running “properly”, but I couldn’t see any image. Nothing. All black.

So I thought, changing everything back to before this “error” appeared, would do the trick. But still the screen is black.

I even tried commenting everything out but the background image – nothing.

Now if it is not too much to ask, could anyone please look over this short piece of code and tell me what is wrong there?

This are the variables I use:

private SmoothCamera camera;
private BitmapTextureAtlas bitmapTextureAtlas;  
private Scene scene;
private Sprite background;

The EngineOptions I never changed, so they should be alright.

@Override
public EngineOptions onCreateEngineOptions() {
    float positionX = 80f; // horizontal (x) position of the camera
    float positionY = 280f; // vertical (y) position of the camera
    float velocityX = 200f; // velocity of the horizontal camera movement
    float velocityY = 200f; // velocity of the vertical camera movement
    float zoomFactor = 1f; // the camera's zoom Factor (standard := 1)
    this.camera = new SmoothCamera(positionX, positionY, this.getWindowManager().getDefaultDisplay().getWidth(), this.getWindowManager().getDefaultDisplay().getHeight(), velocityX, velocityY, zoomFactor);
    EngineOptions options = new EngineOptions(true, ScreenOrientation.LANDSCAPE_SENSOR, new RatioResolutionPolicy(this.camera.getWidth(), this.camera.getHeight()), this.camera);
    return options;
}

Here I create the TextureAtlas and load a background image.

@Override
protected void onCreateResources() {
    // create the TextureAtlas
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
    this.bitmapTextureAtlas = new BitmapTextureAtlas(this.getTextureManager(), 1024, 1600, TextureOptions.NEAREST);

    // background
    this.background = new Sprite(0, 0, BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.bitmapTextureAtlas, this, "background.png", 0, 0, 1, 1), this.getVertexBufferObjectManager());
    this.mEngine.getTextureManager().loadTexture(this.bitmapTextureAtlas);
}

And finally the Scene is instantiated and the background gets attached.

@Override
protected Scene onCreateScene() {
    this.scene = new Scene();
    this.scene.attachChild(this.background);        
    return this.scene;
}

Now why would this small Activity not show? I forgot: its a SimpleBaseGameActivity.

Well, since AndEngine GLES2 is not running on the emulator, I have to use my phone (Samsung Galaxy GIO) and can’t test the app on another machine.

Did anyone stumble upon a similar problem?
Any help is really much appreciated and thank you for your time !

  • Christoph
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:52:36+00:00Added an answer on June 17, 2026 at 3:52 pm

    I think the problem is here:

    this.bitmapTextureAtlas = new BitmapTextureAtlas(this.getTextureManager(), 1024, 1600, TextureOptions.NEAREST);
    

    The dimensions of the Atlas are supposed to be powers of 2.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a game specifically for Android tablets, using andengine. If I use fixed
I am writing a small Android game using a SurfaceView class. The outline of
I am writing a small android game, and whenever I first ran, everything worked
I am writing a bouncing ball game in Java for Android phones. Everything seems
I'm writing a small Android game and am using the WebView for reading an
I'm writing my first android application. I'm using android 2.3.3 SDK. the game is
I'm writing this game on Android where I have a bunch of characters moving
I'm writing a game for Android using libgdx. Here is some code that draws
I am experimenting with writing a small game engine for Android using OpenGL ES.
I am currently writing a game for android where there are enemies that fly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.