我正在尝试编写使用PolygonSpriteBatch
和Pixmap
以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);
丑陋的结果是
问题是-我应该怎么做才能正常平滑地绘制它,而又看不到这里的每个像素?