libgdx tiledmap flicker with Nearest filtering

徘徊边缘 提交于 2019-11-29 12:19:49

I had a similar problem with this, and found it was due to having too small a decimal value for the camera position.

I think what may be happening is some sort of rounding with certain tile columns/rows in the tilemap renderer.

I fixed this by rounding to a set accuracy, like so:

camera.position.x = Math.round(player.entity.getX() * scalePosition) / scalePosition;

Experiment with various values, but I got it working by using the tile size as the scalePosition value.

Nine Magics

About tilesets, I posted a solution here: Getting gaps between tiled textures with libgdx

I've been using that method with Tiled itself. You will have to adjust "margin" and "spacing" when importing tilesets in Tiled to get the effect working.

It's 100% working for me :)

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!