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

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -