Note that there are some explanatory texts on larger screens.

plurals
  1. POAdd background to Andengine scene Android
    text
    copied!<p>I wanna set My Scene Background but I don't know how! I had read a lot about this, but I can't make this works. Is my start with Andengine, and is hard found precise information for my problem, all is subjective.</p> <p>Well, I have implemented the splash screen in a scene, and while load all resources and scenes. (https://sites.google.com/site/matimdevelopment/splash-screen---easy-way)</p> <p>Then, I have to set a Background to my menuScene, I think that I need a TextureRegion and a BitmapTextureAtlas to create each backgroud. I do this:</p> <p>Declared textures:</p> <pre><code> //Fondo escenas private TextureRegion menuBgTexture; private BitmapTextureAtlas menuBackgroundTexture; </code></pre> <p>Load Resources and Load scenes (They are called by onPopulateScene when Splash ends)</p> <pre><code>public void loadResources() { //FondoMenu menuBackgroundTexture = new BitmapTextureAtlas(null, 480, 320, TextureOptions.DEFAULT); menuBgTexture = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.menuBackgroundTexture, this, "menubg.png", 0, 0); //Cargamos los fondos mEngine.getTextureManager().loadTexture(this.menuBackgroundTexture); } private void loadScenes() { //Menú menuScene = new Scene(); final float centerX = (CAMERA_WIDTH - menuBgTexture.getWidth()) / 2; final float centerY = (CAMERA_HEIGHT - menuBgTexture.getHeight()) / 2; SpriteBackground bg = new SpriteBackground(new Sprite(centerX, centerY, menuBgTexture)); menuScene.setBackground(bg); //menuScene.setBackground(new Background(50, 0, 0)); //Options optionsScene = new Scene(); //Juego gameScene = new Scene(); //Pausa pauseScene = new Scene(); //Gameover gameOverScene = new Scene(); } </code></pre> <p>load Resource not shows error, but loadScenes, Line: SpriteBackground bg = new SpriteBackground(new Sprite(centerX, centerY, menuBgTexture));</p> <p>Says me that I have to set a new attribute (ISpriteVertexBufferObject), well, what is this?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload