Class PolygonRegion


  • public class PolygonRegion
    extends java.lang.Object
    Defines a polygon shape on top of a texture region to avoid drawing transparent pixels.
    See Also:
    PolygonRegionLoader
    • Constructor Summary

      Constructors 
      Constructor Description
      PolygonRegion​(TextureRegion region, float[] vertices, short[] triangles)
      Creates a PolygonRegion by triangulating the polygon coordinates in vertices and calculates uvs based on that.
    • Constructor Detail

      • PolygonRegion

        public PolygonRegion​(TextureRegion region,
                             float[] vertices,
                             short[] triangles)
        Creates a PolygonRegion by triangulating the polygon coordinates in vertices and calculates uvs based on that. TextureRegion can come from an atlas.
        Parameters:
        region - the region used for drawing
        vertices - contains 2D polygon coordinates in pixels relative to source region
    • Method Detail

      • getVertices

        public float[] getVertices()
        Returns the vertices in local space.
      • getTriangles

        public short[] getTriangles()
      • getTextureCoords

        public float[] getTextureCoords()