简体   繁体   中英

libgdx game, graphics are not displayed on ldpi screen

I am loading all assets at the beginning of game play but on ldpi mobiles, after splash screen, it shows a white screen and I get the error egl swap memory buffer. my code is as follows: in splash screen at constructor:

Assets.loadAssets();

in updateMethod

if(Assets.manager.update())    
{
    Assets.getLoadAssets();
    gameSplashObj.setScreen(new MainMenu(gameSplashObj));    
}

but I will get white screen. Am I doing something wrong or any other optimize way to achieve this.

That usually happens (images as plain white) when the texture you are loading is bigger than the max texture size the device can handle (GL_MAX_TEXTURE_SIZE).

If you plan on supporting ldpi devices, consider making your textures smaller.

one easy way to solve this problem is While packing the image **

set maximun width and height to 512 ,512 or even lower 256 ; instead of 1024 or 2048.

** this way your graphics size will also not increase and on same time it solves problems with ldpi devices

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM