com.badlogic.gdx.graphics.g2d
Class PolygonRegion
java.lang.Object
com.badlogic.gdx.graphics.g2d.PolygonRegion
public class PolygonRegion
- extends Object
Defines a polygon shape on top of a texture region to avoid drawing transparent pixels.
- Author:
- Stefan Bachmann, Nathan Sweet
- See Also:
PolygonRegionLoader
Constructor Summary |
PolygonRegion(TextureRegion region,
float[] vertices,
short[] triangles)
Creates a PolygonRegion by triangulating the polygon coordinates in vertices and calculates uvs based on that. |
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 drawingvertices
- contains 2D polygon coordinates in pixels relative to source region
getVertices
public float[] getVertices()
- Returns the vertices in local space.
getTriangles
public short[] getTriangles()
getTextureCoords
public float[] getTextureCoords()
getRegion
public TextureRegion getRegion()
Copyright © 2013. All Rights Reserved.