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

  • SEARCH
  • Home
  • 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 6561369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:34:43+00:00 2026-05-25T13:34:43+00:00

i have took a look to andengine a few months ago, and i managed

  • 0

i have took a look to andengine a few months ago, and i managed to make something out of it.
Now i downloaded the newest version, and i’m having a crash for the simplest thing. Here my code

package francesco.mygame;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.engine.options.EngineOptions;
import org.anddev.andengine.engine.options.EngineOptions.ScreenOrientation;
import org.anddev.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;
import org.anddev.andengine.entity.scene.Scene;
import org.anddev.andengine.entity.scene.background.ColorBackground;
import org.anddev.andengine.entity.sprite.Sprite;
import org.anddev.andengine.entity.util.FPSLogger;
import org.anddev.andengine.opengl.texture.TextureOptions;
import org.anddev.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas;
import org.anddev.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory;
import org.anddev.andengine.opengl.texture.region.TextureRegion;
import org.anddev.andengine.ui.activity.BaseGameActivity;



public class mainMenu extends BaseGameActivity 
{

// ===========================================================

// Constants

// ===========================================================
static final int CAMERA_WIDTH = 480;

static final int CAMERA_HEIGHT = 320;



//private static final String TAG = "Main Menu";


// ===========================================================

// Fields

// ===========================================================

protected Camera mCamera;  
protected BitmapTextureAtlas mTexture;
protected TextureRegion mPlayTexture;
protected Sprite mPlaySprite;
protected Sprite mQuitSprite;
protected TextureRegion mQuitTexture;
protected Scene mMainScene;

// ===========================================================

// Constructors

// ===========================================================



// ===========================================================

// Getter & Setter

// ===========================================================



// ===========================================================

// Methods for/from SuperClass/Interfaces

// ===========================================================



@Override

public void onLoadComplete() 
{

// TODO Auto-generated method stub


}



@Override

public Engine onLoadEngine() 
{

    this.mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);

    return new Engine(new EngineOptions(true, ScreenOrientation.LANDSCAPE, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), this.mCamera));

}



@Override

public void onLoadResources() 
{
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");

    this.mTexture = new BitmapTextureAtlas(64, 128, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
    this.mPlayTexture = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.mTexture, this, "play.png", 0, 0);
    this.mQuitTexture = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.mTexture, this, "quit.png", 0, 40);

    this.mEngine.getTextureManager().loadTexture(this.mTexture);

}



@Override

public Scene onLoadScene() 
{

    this.mEngine.registerUpdateHandler(new FPSLogger());
    this.mMainScene = new Scene();
    this.mMainScene.setBackground(new ColorBackground(0.09804f, 0.6274f, 0.8784f));

    int play_x = (CAMERA_WIDTH + this.mPlayTexture.getWidth() )/2 ;
    int play_y = (CAMERA_HEIGHT + this.mPlayTexture.getHeight())/2 - this.mPlayTexture.getHeight();
    this.mPlaySprite = new Sprite( play_x, play_y, this.mPlayTexture);

    int quit_x = (CAMERA_WIDTH + this.mQuitTexture.getWidth() )/2 ;
    int quit_y = (CAMERA_HEIGHT + this.mQuitTexture.getHeight())/2 + this.mQuitTexture.getHeight();
    this.mQuitSprite = new Sprite(quit_x, quit_y, this.mQuitTexture);

    this.mMainScene.attachChild(mPlaySprite);
    this.mMainScene.attachChild(mQuitSprite);

    return this.mMainScene;

}



// ===========================================================

// Methods

// ===========================================================



// ===========================================================

// Inner and Anonymous Classes

// =========================================================== 

}

(Usually it is well indented)

The logCat error is

Failed loading Bitmap in AssetBitMapTextureAtlasSource. Asset path: gfx/play.png

java.io.FileNoFoundException: gfx/play.png

But i put the 2 images in the folder and i added them to the project like i did when i first tried andengine(and it worked)..
So i don’t really understand where the problem is..

The images are 2 png created with the gimp(one is 57×36 and the other 58×31).

  • 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-05-25T13:34:43+00:00Added an answer on May 25, 2026 at 1:34 pm

    A java.io.FileNoFoundException will be thrown if a file wasn’t found – so there is no other possibility than the engine couldn’t found the image.

    Make sure your images are in: assets/gfx/ and not just in a folder called gfx/.

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

Sidebar

Related Questions

I have a peice of HTML I took from the source of my Twitter
I have the following text file 40 timesteps took 58.320842 seconds greetings 0 80
I have a data access class that took me a while to get working.
Ok i have this piece of code from which i took from W3schools :-
I have seen behaviour in Perforce that I am unable to explain. I took
I have created an application using Adobe Flex. I took all the files from
I have a module Namespace/Search, which was installed when I got here. I took
I have a query that reads like this: $fields = Doctrine_Core::getTable('model_1')->findByColumnId($id); took a var_dump
I have been stuck on this problem for a while now. I want to
I took a look about this problem within the list of question but nothing

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.