绘制LibGDX

时间:2018-08-29 09:07:18

标签: java libgdx

我正在尝试编写使用PolygonSpriteBatchPixmap以1x1大小绘制填充多边形的应用程序:

Pixmap pixmap = new Pixmap(1, 1, RGBA8888);
pixmap.setColor(color);
pixmap.fill();
Texture texture = new Texture(pixmap(color));
texture.setWrap(Repeat, Repeat);
TextureRegion region = new TextureRegion(texture);
PolygonRegion polygon = new PolygonRegion(region, vertices, triangles);
PolygonRegionDrawable drawable = new PolygonRegionDrawable(polygon);

并绘制它:

PolygonSpriteBatch batch = new PolygonSpriteBatch();
drawable.draw(batch, x, y, width, height);

丑陋的结果是

enter image description here

问题是-我应该怎么做才能正常平滑地绘制它,而又看不到这里的每个像素?

0 个答案:

没有答案