2

I can use both with the PolygonSpriteBatch to print a Polygon, ie:

Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
pixmap.setColor(0x00CC00FF);     // DE is red, AD is green and BE is blue.
pixmap.fill();

Texture texture = new Texture(pixmap);
TextureRegion textureRegion = new TextureRegion(texture);
//textureRegion.flip(false, true);     //doesn't do anything =(

PolygonRegion polygonRegion = new PolygonRegion(textureRegion, polygonVertices, 
new short[] { 0, 1, 2, 0, 2, 3});    //triangle to fill in polygon

PolygonSprite polygonSprite = new PolygonSprite(polygonRegion);

PolygonSpriteBatch polygonSpriteBatch = new PolygonSpriteBatch();

should I use:

polygonSprite.draw(polySpriteBatch);

OR

polygonSpriteBatch.draw(polygonRegion, 0, 0);

The above both draw a polygon, but which should I use?

Also how do I flip their y-axis so that I draw from the top left instead of the bottom left?

This has been haunting me for hours, tysm for any help.

Korb
  • 33
  • 3

0 Answers0