Dans Android Studio, j'essaie de créer un sprite avec AndEngine, mais il n'a pas réussi à afficher l'image-objet, il ne montre qu'un écran noir. J'ai cherché et essayé différentes méthodes pendant des heures.AndEngine ne peut pas afficher l'image-objet
Voici la structure:
-myApplication
-andEngine
-app
-res
-drawable
-stand.png
Voici les codes:
@Override
public void onCreateResources() {
this.mBitmapTextureAtlas = new BitmapTextureAtlas(getTextureManager(), 30, 30, TextureOptions.DEFAULT);
mPlayerTextureRegion = BitmapTextureAtlasTextureRegionFactory.createFromResource(mBitmapTextureAtlas, this, R.drawable.stand, 0, 0);
mBitmapTextureAtlas.load();
}
@Override
public Scene onCreateScene() {
this.mEngine.registerUpdateHandler(new FPSLogger());
this.mMainScene = new Scene();
this.mMainScene.setBackground(new Background(1, 1, 1));
final Sprite oPlayer = new Sprite(100, 100, mPlayerTextureRegion, getVertexBufferObjectManager());
this.mMainScene.attachChild(oPlayer);
return this.mMainScene;
}
Toute aide sera appréciée
Merci.
J'ai terminé le jeu avec JBox2d, si j'ai le temps, je peux le tester avec AndEngine à nouveau, Merci quand même. – jdleung