当我为我的应用程序渲染背景图像时,我目前遇到了问题。如您所见,它的边缘呈锯齿状:
现在,这是我用来加载图像的代码,我已经尝试了所有可能的过滤组合,所以这不是我唯一尝试过的。
newPenguinGraphic = new Texture(Gdx.files.internal("data/1024Set1.png"),true);
texture.setFilter(TextureFilter.MipMapLinearNearest, TextureFilter.Nearest);
画面设置:
float gameWidth = 330;
float gameHeight = screenHeight / (screenWidth / gameWidth);
int midPointY = (int) (gameHeight / 2);
凸轮:
cam = new OrthographicCamera();
cam.setToOrtho(true, 330, gameHeight);
形象的:
MainBackground = new BGScroller(0, yPos-165, 330, 220, SCROLL_SPEED, yPos);
原始图像的大小也是 688x459。
我一直想知道的一个问题是,我是否需要先生成 mipmap png 文件并手动加载它们,还是 libgdx 在运行时创建它们?请帮忙,谢谢!!