且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

libgdx 纹理过滤器和 mipmap

更新时间:2023-01-26 16:53:41

我也遇到了同样的问题,但修复起来非常简单.创建 Texture 时,需要指定它使用 mipmap.

I had this same problem, and the fix turned out to be insanely simple. When you create a Texture, you need to specify that it uses mipmaps.

您所要做的就是将第二个参数传递给 Texture 构造函数,如下所示:

All you have to do is pass a second parameter to the Texture constructor like this:

Texture myTexture = new Texture(Gdx.files.internal("myImage.png"), true);

您可以在此处查看 API 文档中的所有 Texture 类构造函数:http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/Texture.html

You can view all the Texture class constructors in the API docs here: http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/Texture.html