android - How to make AutoParallaxBackground fit to the screen -


I am developing an Android game with andengine, I use AutoParallaxBackground while repeating the background but on my background image screen Is not fit for How to solve the same

This is my code

  AutoParallaxBackground autoParallaxBackground = new AutoParallaxBackground (0, 0, 0, 10); AutoParallaxBackground.attachParallaxEntity (New ParallaxEntity (-25.0F, New Sprite (0, 0, PageRemissionRegion, Engine .getVertexBufferObjectManager ()))); GameScene.this.setBackground (autoParallaxBackground);   

Thank you in advance

You attempt to scale the phantom To make the screen fit before creating ParallaxEntity, something like:

  AutoParallaxBackground autoParallaxBackground = New AutoParallaxBackground (0, 0, 0, 10); Sprite MySprit = New Sprite (0, 0, Background Titration Regions, EngineGetWortexBufferObjectManager ()); MySprite.setScaleY (1.0 F / (mySprite.getHeight () / CAMERA_HEIGHT)); MySprite.setScaleX (1.0F / (mySprite.getWidth () / CAMERA_WIDTH)); AutoParallaxBackground.attachParallaxEntity (New ParallaxEntity (-25.0f, mySprite)); GameScene.this.setBackground (autoParallaxBackground);    

Comments

Popular posts from this blog

python - how we can use ajax() in views.py in django? -

matlab - Using loops to get multiple values into a cell -

python - Sequence Pattern recognition with Pybrain -